Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Java Verbal Expressions. Parent comment
We see this as early as in code review and as late as when you find a production bug because expectations of the surrounding code have changed.
For those reasons, we usually break regexes into parts anyway, and name and comment the single parts. Using the library's example, we might have:
protocol = "^(?:http)(?:s)?" protocol_separator = "(?:\:\/\/)" url = "(?:www\.)?(?:[^\ ]*)$" regex = protocol + protocol_separator + url
There are no comments on this comment yet.
We see this as early as in code review and as late as when you find a production bug because expectations of the surrounding code have changed.
For those reasons, we usually break regexes into parts anyway, and name and comment the single parts. Using the library's example, we might have:
Which turns out to be in the direction of these Java Verbal Expressions. I find the Verbal Expressions idea really enlightening.