DEV Community

Discussion on: What is an analogy or visualization of a coding concept that really helped you understand it better?

Collapse
 
kallmanation profile image
Nathan Kallman

Seeing Regular Expressions drawn into their finite state machine graphs (just circles with arrows between them).

That it's just moving from one state to another based on matching a character. And all regex could boil down to a language of four things:

  1. c match any literal character (like c)
  2. | or operation (match this or that)
  3. * loop
  4. () group

The rest of it mostly being helpful sugar.

Collapse
 
pomfrit123 profile image
***

Do you have link of that?

Collapse
 
kallmanation profile image
Nathan Kallman

Here's a graph generator; if you want to visualize what I'm talking about: regexper.com/#a(b%7Cc)*d

The explanation of the concepts came from a university course though... maybe I should do an article about this so I can link it as an explanation of what I'm talking about...