I consider sed to be the baseline. If you can do sed you can do anything but it’s seriously limited.
I consider sed to be the baseline. If you can do sed you can do anything but it’s seriously limited.
The regular expression engines available in most mainstream languages go well beyond what is specified in POSIX though. An interesting example is named capturing group in Python, e.g., (?P<token>f[o]+).
Oddly, there are no backreferences in POSIX EREs.
Quoting from <https://pubs.opengroup.org/onlinepubs/9699919799.2008edition...>:
> It was suggested that, in addition to interval expressions, back-references ( '\n' ) should also be added to EREs. This was rejected by the standard developers as likely to decrease consensus.
Updated my comment to present a better example that avoids back-references. Thanks!
Edit: oh, you mean via regex engines available in GNU tools; I am dumb. Hmm... is there no GNU extension with PCRE?
Maybe there's some other implementation of sed that supports PCREs but that would really be an extension of that implementation of sed rather than a property of sed.
And maybe there's some GNU tool that uses PCREs, but that GNU tool would not be GNU sed, so it would not be a relevant property.
Anyway, they probably should have said BREs or EREs rather than "sed"...
It's a problem for Linux that it can't move on. The cold dead hand of gnu is firmly around the community's neck.
Android, Busybox and Muscl have entered the chat