Re:Advanced Regular Expressions
by 10ren on Thursday May 07, 2009 @01:49PM
(#598340)
I hadn't seen recursive regex before (almost a tautology). The operator in the article, "(R?)", isn't in Perl (v5.8.8).
[ Parent
| on HN ]
Re:Advanced Regular Expressions
by DEinspanjer on Thursday May 07, 2009 @02:24PM
(#598408)
Yeah. PHP syntax. From what I understand, they stuffed it in there mostly to allow easier processing of nested HTML tags and such.
I did some experimenting with recursive regexes after reading this article. I hadn't heard of it before and it sounded like an interesting concept.
However, captures in the recursion can't be retrieved after it gets returned. This may not be surprising, but it does reduce the power of recursion somewhat.