Hacker News new | ask | show | jobs
by mycall 2245 days ago
Recursive RegEx has always been confusing to me.

https://www.rexegg.com/regex-recursion.html

1 comments

Railroad diagrams may help. I use a three step approach to present one example of recursion, which includes showing the difference between two-level nesting vs recursive version [1]. This is the railroad visualization for two-level [2].

[1] https://github.com/learnbyexample/py_regular_expressions/blo...

[2] https://www.debuggex.com/r/SMLRfiyt0Ag2hXu5