I stumbled upon a weird behaviour of Apple’s awk regarding the equivalence classes, so I’m trying to understand the specifics of the regex parser:
string | regexp | gsub(regexp, "_", string) |
---|---|---|
anything |
[[=a] |
awk: nonterminated character class |
][=ab |
[[=a]] |
_[=ab |
anything |
[[=a=] |
awk: nonterminated character class |
][=ab |
[[=a=]] |
][=_b |
][=ab |
[[=ab] |
][=a_ |
][=ab |
[[=ab=] |
][_a_ |
][=ab |
[[=ab=]] |
][=ab |
][=ab( |
[[=ab(=] |
][_a__ |
Is it possible to forge a multi-platform test (BSD,Apple,GNU,POSIX) for determining that the regex engine behave like this, without making awk
crash?