Re:Parsoid in PHP, or There and Back Again
by TeMPOraL on Thursday February 13, 2020 @03:46AM
(#22316268)
You jest, but that regex looks machine-generated. My Emacs is full of these in places used for syntax coloring, but I know these are optimized. There's an elisp function, regex-opt, into which you can throw a bunch of strings, and you get out a regex like above.
[ Parent
| on HN ]
Re:Parsoid in PHP, or There and Back Again
by SXX on Thursday February 13, 2020 @04:27AM
(#22316428)
To be honest I was serious. Personally I believe that regular expressions is one of few tools that super useful even for people outside of IT because everyone have to extract of format some text or table data from time to time. You can even learn them just by playing game:
Re:Parsoid in PHP, or There and Back Again
by TeMPOraL on Thursday February 13, 2020 @05:32AM
(#22316660)
The example quoted required some mental work to unparse, so I assumed you're joking.
But in general, I agree with you. Regular expressions aren't hard, and there's no excuse for not learning to read and use them.