my $regex = qr(/.../); # ... implies put any pattern here
Can I compile with qr another regex $notregex that is true if and only if $regex is false?
I know I can use $regex with !~ to get this effect, but I situations where it would be more elegant to simply pass in the new regex.
Now, supposing that this is possible. Could one write a subroutine that takes one regex as input and returns the "does not match" regex as output?
In reply to Negation/Complement of a Regex by geekondemand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |