Here on SO people sometimes say something like \"you cannot parse X with regular expressions, because X is not a regular language\". From my understanding however, modern re
I recently wrote a rather long article on this topic: The true power of regular expressions.
To summarize:
a^n b^n).ww and a^n b^n c^n).Some examples:
Matching the context-free language {a^n b^n, n>0}:
/^(a(?1)?b)$/
# or
/^ (?: a (?= a* (\1?+ b) ) )+ \1 $/x
Matching the context-sensitive language {a^n b^n c^n, n>0}:
/^
(?=(a(?-1)?b)c)
a+(b(?-1)?c)
$/x
# or
/^ (?: a (?= a* (\1?+ b) b* (\2?+ c) ) )+ \1 \2 $/x