Re:Regexper – Regular expressions visualizer
by singingfish on Tuesday January 30, 2018 @05:41PM
(#16269774)
Here, have a 1800 line regex which parses perl: https://metacpan.org/source/DCONWAY/PPR-0.000003/lib/PPR.pm#...
Re:Regexper – Regular expressions visualizer
by avar on Tuesday January 30, 2018 @04:05PM
(#16269013)
I can't remember where, but there's some version of that regex somewhere that uses variables for interpolation in subsequent regexes.
Viewed like that it's really not that complex, most of it is repetition of previously used regex sequences, it's only when fully expanded that it becomes so humongous.
Re:Regexper – Regular expressions visualizer
by shakna on Tuesday January 30, 2018 @06:26PM
(#16270065)
The pattern is Jeffrey Friedl's, from his book Mastering Regular Expressions.
And as clear as the source could be made, I feel the fact that so many people have just copied and pasted it means that any understanding is lost, and they're just praying and hoping, because a regex of that size is actually difficult for them to comprehend.
That being said... That regex is just noise. Nobody can tackle it all at once or by themselves, unless they specialise in just regex. It's 6599 characters, at least on my system. So at a wild stab, its the equivalent of 4,500 lines of obfuscated code.
You can't audit it, you just kinda have to trust it, and hope.
But with something like regexper, I can at least read it.