3 ms·
I'm confused. Doesn't Python offer verbose regular expressions complete with comments? https://docs.python.org/3/library/re.html#re.VERBOSE https://docs.python
by ddebernardy 9y ago
I'm confused. Doesn't Python offer verbose regular expressions complete with comments?
https://docs.python.org/3/library/re.html#re.VERBOSE https://docs.python.org/3/library/re.html#re.VERBOSE
a = re.compile(r"""\d + # the integral part
\. # the decimal point
\d * # some fractional digits""", re.X)
Or is there more at stake than making readable, self-documenting regular expressions?
- always_good 9y agoIt has the same advantages as combinators: the total computation can be broken down into pieces, tested individually, and then composed and reused, especially programmatically. Why use functions when you can have one big main(args: Array<String>) with inline comments? btw, a hello-world snippet like /\d+\.\d*/ isn't very scathing criticism of a library.