4 ms·
I added this to the Alternative Regex Syntax wiki page with about a dozen similar projects: https://github.com/oilshell/oil/wiki/Alternative-Regex-Syntax https
by chubot 4y ago
I added this to the Alternative Regex Syntax wiki page with about a dozen similar projects:
https://github.com/oilshell/oil/wiki/Alternative-Regex-Syntax https://github.com/oilshell/oil/wiki/Alternative-Regex-Synta...
e.g. compare with Melody 3 months ago: https://news.ycombinator.com/item?id=30358554 https://news.ycombinator.com/item?id=30358554
and Oil's Eggex:
https://www.oilshell.org/release/latest/doc/eggex.html https://www.oilshell.org/release/latest/doc/eggex.html
From a quick glance Rulex looks very similar to Eggex!
A difference is that Eggex is embedded in a shell so you can use normal assignment statements to build up subpatterns. And you can also interpolate directly into an 'egrep' or 'awk' command.
- runlevel1 4y agoWhat I'm liking about Rulex is that it's striking a good balance between what's new (mainly readability improvements) and what's familiar. It's close enough to Regex that I could probably get used to it in a few hours. Looking through the items on that list, IMO only Oil's Eggex seems to hit that same sweet spot.
- chubot 4y agoYes that's my assessment too! Funny thing is that I designed a similar project called "Annex" in Python around 2014. But when I looked back on it after a few years with fresh eyes, it was just too different! It was hard to remember. So Eggex is very similar to the common syntax -- it's actually roughly the same as lex or re2c. I think there's a case to make that we we ALREADY have a good syntax for regexes in lexer generators -- it's just the POSIX/Perl syntax that is bad! The other thing about Annex is that it was a Python library, and it was never worth the extra dependency. (IMO PyPI has a lot of friction.) That is, after writing it, I already knew stdlib re syntax so well it wasn't worth it :) But Eggex is in a shell, which is a context that makes a lot of sense IMO.