2 ms·
FWIW this is one reason I designed the Eggex sublanguage of Oil to translate to extended regexps: so you can use it with egrep, awk, and sed --regexp-extended.
by chubot 6y ago
FWIW this is one reason I designed the Eggex sublanguage of Oil to translate to extended regexps: so you can use it with egrep, awk, and sed --regexp-extended.
https://www.oilshell.org/release/latest/doc/eggex.html https://www.oilshell.org/release/latest/doc/eggex.html
It really annoys me to have to remember multiple syntaxes for regexes in shell scripts!
Also, even if you added Perl syntax to sed today, it wouldn't be available everywhere. Oil isn't available everywhere either but there are some advantages to having the syntax in the shell rather than in every tool.
(It's also easy to translate eggex to the BRE syntax or Perl syntax, but nobody has done so yet)
- j1elo 6y agoAlbeit the typical first reaction might be that of XKCD 927 (I must confess it was mine, at least), I believe that the regular expressions area is territory that could see some innovation. If told to pick just one feature from eggex, I'd choose the ability to parse statically! FWIW I think this deserves a submission of its own, so here it is: https://news.ycombinator.com/item?id=26408510 https://news.ycombinator.com/item?id=26408510