3 ms·
Also, check for your language's options for white space and comments within regular expressions [0]. Regexps don't have to be blobs of characters -- you can use
by erichurkman 13y ago
Also, check for your language's options for white space and comments within regular expressions [0]. Regexps don't have to be blobs of characters -- you can use white space to make them more readable and use comments embedded within a multi-line regexp to describe what/why you are doing.
Bonus: it makes them easier to diff, too!
We don't write our code on one line with no comments, writing regexps should be no different.
[0] Python example: http://docs.python.org/2/library/re.html#re.VERBOSE http://docs.python.org/2/library/re.html#re.VERBOSE