3 ms·
Ruby regular expressions have a \g operator which lets you call a sub expression - so technically they could be used to parse HTML if you're a masochist.
by charliesome 14y ago
Ruby regular expressions have a \g operator which lets you call a sub expression - so technically they could be used to parse HTML if you're a masochist.
- pjscott 14y agoPropriety requires that someone point out that any "regular expression" permitting recursion is not, in fact, a regular expression in the formal sense. Luckily for anybody wanting to do it anyway, parsing expression grammars can handle that sort of thing with theoretical aplomb: http://en.wikipedia.org/wiki/Parsing_expression_grammar http://en.wikipedia.org/wiki/Parsing_expression_grammar