That is, given a POSIX regex X, what POSIX regex is the complementary of X? (in a more detailed way: how to get regex X' that matches all strings that are not matched by X, but doesn't match any string that is matched by X)
If this is not available in POSIX, is there a common extension that has it?
$foo!~/bar/
?if not match
instead ofif match
so you use the same regexp. Your question would be easier to answer if you had a specific use case.?
is involved (like in bash extglob).