The author is circling around, but not quite reaching, a statement that POSIX Basic Regular Expressions work everywhere, with the caveat that that not everyone has caught up with version 8 of the Single Unix Specification, which has slightly changed BREs.
I've always been a stickler for being specific about which regex language your thing accepts, and whether it is to match any substring, or a prefix, or a suffix, or the whole thing, or a line, or a substring of a line, or whatever.<p>Here are some of the [more popular][1] ones, and then there are PCRE and Python.<p>It took me a while to learn that some of the older ones you see in e.g. grep are [specified by POSIX][2].<p>[1]: <a href="https://cppreference.com/cpp/regex#Regular_expression_grammars" rel="nofollow">https://cppreference.com/cpp/regex#Regular_expression_gramma...</a><p>[2]: <a href="https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd_chap09.html" rel="nofollow">https://pubs.opengroup.org/onlinepubs/009696899/basedefs/xbd...</a>
A while ago, we wrote a paper about finding regexes which match the same way in both the greedy semantics and the leftmost maximal semantics.<p><a href="https://par.nsf.gov/servlets/purl/10534654" rel="nofollow">https://par.nsf.gov/servlets/purl/10534654</a>
It drives me nuts when a developer documents something or other as being a "regex" but doesn't mention which <i>dialect</i> of regulation expression he's talking about. This habit is particularly common in the Rust, JavaScript, and Python communities, which seem to forget that their language's regular expression language isn't universal.
Why? <i>Of course</i> it means the dialect that is most directly supported by that language (by builtins or the standard library). And why should they have to consider other dialects? They aren't reading regexes from user input (or they'd be a lot more concerned about sanitization, catastrophic backtracking etc.), and their fellow developers all grok the conventions.
Then there’s not just the issue of whether the engine supports a particular syntactical feature but the issue of matching semantics. Perl/PCRE’s semantics are far different from POSIX’s and some implementations different semantics altogether (and quite reasonably).
> the special characters . * ^ $<p>These already do not work in many tools which require those special characters to be escaped to have any meaning. An easy example is GNU grep, sed, etc. which use BRE ("Basic Regular Expressions") by default. The article mentions GNU coreutils but does not explain that `-E` is required to fix that behavior.
[dead]
why I built this