3 ms·
> ... comp.lang.emacs Wasn't the quote from comp.religion.emacs? But seriously, regular expressions are often ill-advised, as solutions based on them are freq
by jll29 6y ago
> ... comp.lang.emacs
Wasn't the quote from comp.religion.emacs?
But seriously, regular expressions are often ill-advised, as solutions based on them are frequently:
- over-matching: they match things in cases where they shouldn't, because a situation wasn't anticipated by the developer
- under-matching: not catching some input they should because a regular pattern was formulated to narrowly by the developer
- matching the wrong thing altogether because they are hard to stay on top of, even when it's one you wrote
- matching something, but you don't understand what and how it works, because regexes are "write only".
There is even another case:
- They work but they are the wrong instrument, because you try to model something that requires context-free generative capacity (e.g. syntax coloring)
Interestingly, at Xerox Research Centre Europe (now Naver Labs) in Grenoble a much more elegant (more powerful yet more readable, and symmetric between inputs and outputs) has been developed as an alternative, mostly to write linguistic rules with it.
For more info:
* http://users.itk.ppke.hu/~sikbo/nytech/gyak/05_morfo/xfst/book.pdf_1.pdf http://users.itk.ppke.hu/~sikbo/nytech/gyak/05_morfo/xfst/bo...
* https://press.uchicago.edu/ucp/books/book/distributed/F/bo3613750.html https://press.uchicago.edu/ucp/books/book/distributed/F/bo36...
* There is an open-source implementation called FOMA: https://fomafst.github.io/ https://fomafst.github.io/
- renewiltord 6y agoIt's in the article: alt.religion.emacs