3 ms·
Regular expressions can only parse regular languages. More powerful parser techniques can parse context-free languages or even recursively enumerable languages.
by senkora 4y ago
Regular expressions can only parse regular languages. More powerful parser techniques can parse context-free languages or even recursively enumerable languages. These are fundamentally distinct levels of complexity.
It is fundamentally impossible to correctly parse e.g. HTML with regular expressions. See: https://stackoverflow.com/a/1732454 https://stackoverflow.com/a/1732454
- rob74 4y agoAh yes, the classic StackOverflow answer. If that doesn't teach you not to parse HTML with regex, nothing will...