News for hackers. Stuff that matters.
Re:ECMAScript regular expressions are getting better (2017) by setr on Thursday November 29, 2018 @04:29AM (#18559050)
The main issue I think is that they get convoluted...fast. Combined with varying dialects, the issue that they’re usually write-once, update rarely, and all regexes are imperfect and will fail in unexpected fashions, and that they usually don’t appear that many times in any given codebase, means that they’re never really worth the effort of properly memorizing. Understanding is fine, its not that complex and each operator is relatively simple conceptually, but I have to re-lookup the regex syntax anytime I’m writing/reading any regex that goes beyond pure regex (*+.|)

Character classes beyond \w, d and b always require a doc-lookup and I always misremember the look{ahead,behind} operators.

The issue is that its too small to remember fully, makes no effort to be self-documenting, the docs are always annoying (I can never get a ^F search to not return 20 items), and theres always an uncovered edge case somehow

There are no comments on this comment yet.