Is there a regular expression to detect a valid regular expression? (2008)(stackoverflow.com) |
Is there a regular expression to detect a valid regular expression? (2008)(stackoverflow.com) |
https://stackoverflow.com/questions/49650847/determine-if-st...
The answer is yes, they’re regular. :-D
Edit: I just checked and sadly someone beat me to it in 2019: https://news.ycombinator.com/item?id=20910120
Edit: "The PPR module provides a single regular expression that defines a set of independent subpatterns suitable for matching entire Perl documents, as well as a wide range of individual syntactic components of Perl (i.e. statements, expressions, control blocks, variables, etc.)"
Is there a regular expression to detect a valid regular expression? - https://news.ycombinator.com/item?id=20909939 - Sept 2019 (219 comments)
[0] : https://web.mit.edu/6.005/www/fa15/classes/17-regex-grammars...
[1] : https://peerj.com/preprints/1248.pdf
[2] : https://www.cs.ox.ac.uk/ralf.hinze/WG2.8/28/slides/fritz-pap...
[3] : https://www.npmjs.com/package/regexp-tree
[4] : example bnf grammar for regular expressions : https://github.com/DmitrySoshnikov/regexp-tree/blob/master/s...
I'm not sure what this means. Have we asked and answered all the good questions already?
protip 2: good regex implementations often have extensions that support counters.