4 ms·
Something that I have always wished for is a more human readable dsl for regex. I don't really mind developing regex, but revisiting a complex regex years late
by diveanon 5y ago
Something that I have always wished for is a more human readable dsl for regex.
I don't really mind developing regex, but revisiting a complex regex years later without docs is extremely painful.
- coldtea 5y agoThere are a few. E.g.: https://verbalexpressions.github.io/ https://verbalexpressions.github.io/
- diveanon 5y agonice link, thanks for sharing
- fouc 5y agoI agree, I would think there should be a better DSL at the finite state machines/automaton/grammar level, but designed such that regular expressions could be implemented in trivially and in a readable manner.
- slimsag 5y agoPerl's regex engine actually supports defining regex in human readable groups[0] which I think is pretty nice. In my regex engine[1], I'm adding support for a blended mix of plain regex syntax and EBNF-like definition syntax, so you can do something similar. [0] https://stackoverflow.com/a/1917982 https://stackoverflow.com/a/1917982 [1] https://github.com/hexops/zorex https://github.com/hexops/zorex
- SonOfLilit 5y agoI have a (mostly abandoned, since I couldn't find an organization to cbe early adopter in the time I gave myself to work on it) side project with this aim. I spent a lot of time thinking about language design, from the perspective of enabling adoption of a new language when an existing one has so much network effect: https://www.slideshare.net/AurSaraf/re3-modern-regex-syntax-with-a-focus-on-adoption https://www.slideshare.net/AurSaraf/re3-modern-regex-syntax-... https://github.com/sonoflilit/re2 https://github.com/sonoflilit/re2
- e12e 5y agoDid you look at SNOBOL/REBOL/SPITBOL/RED? https://www.red-lang.org/2013/11/041-introducing-parse.html https://www.red-lang.org/2013/11/041-introducing-parse.html