3 ms·
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
by TeMPOraL 7y ago
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.
- SXX 7y agoTo 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: https://regexcrossword.com/ https://regexcrossword.com/
- TeMPOraL 7y agoThe 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.