6 ms·
I don't really think this is more readable than the regex itself once it starts to get complex, like they all do. Maybe if this was implemented on a prefix not
by stonewhite 9y ago
I don't really think this is more readable than the regex itself once it starts to get complex, like they all do.
Maybe if this was implemented on a prefix notation language it may have would looked/read better
- fiddlerwoaroof 9y agoI really like the way Common Lisp's ppcre library works: the functions all accept either standard strings or a s-expression version of the regular expression and then, using compiler macros, all invocations with statically-determinable regular expressions get compiled to some internal representation at compile-time rather than generating that representation at run-time. http://weitz.de/cl-ppcre/#create-scanner2 http://weitz.de/cl-ppcre/#create-scanner2
- iogf 9y agoThe example is longer than the regex itself however it is simpler to explain to a beginner what crocs's example does than explaning the regex itself. Based on that assumption using crocs's syntax should favour reasoning somehow since it is simpler to understand than obscure regex's syntax.