3 ms·
> 2) Regular expressions can only parse regular languages This is false, regular expressions as popularly implemented can parse non-regular languages. For exa
by bawolff 6y ago
> 2) Regular expressions can only parse regular languages
This is false, regular expressions as popularly implemented can parse non-regular languages.
For example, /^(.*)\1$/ is a non regular language.
- exmadscientist 6y agoStrictly (pedantically) speaking, using a backreference turns it from a "regular expression" into a "regex", regexes being a superset of regular expressions that are no longer strictly limited to being regular. Isn't terminology great?
- jjtheblunt 6y agoIt's true, not false. You refer to a misleading overloading of the term when referring to the stack machines needed to realize 'regular expressions with backreference memories', which expands the language class to which they correspond. Citation : https://www.amazon.com/Introduction-Automata-Languages-Computation-Addison-Wesley/dp/020102988X https://www.amazon.com/Introduction-Automata-Languages-Compu...
- bawolff 6y agoContext matters, in the context of the original post that was not how they used the term.