
On Tue, Feb 15, 2022 at 6:13 PM Chris Angelico <rosuav@gmail.com> wrote:
Once upon a time, a "regular expression" was a regular grammar. That is no longer the case.
I use "regex" for the weird backtracking minilanguages and deliberately never call them "regular expressions". (I was under the impression that the Perl documentation observed the same convention but that doesn't seem to be true.) Once upon a time, a regular expression could be broadly compatible with
multiple different parser engines.
I think there never was such a time, at least not if you wanted syntactic compatibility. Is there any sort of standardization of regexp syntax and semantics[...]?
I'm not sure there needs to be. There is no standardization of programming-language syntax in general, unless you count conventions like {...} for blocks which Python ignores. The problem as I see it isn't that the syntax isn't standardized. It's that the syntax, to the extent it is standardized, is terrible. The only traditional Unix tool whose regular expression syntax isn't godawful is lex, and unfortunately that isn't the one that caught on.