Sometimes double negation is difficult to understand ...
More than just sometimes, IMHO, but it's tolerable if taken in moderation. E.g., if you need a "digit boundary" assertion analogous to \b in that it also matches at the start/end of a string, then (?<! \d) and (?! \d) are very attractive. Then (?<! \d) \d{4} (?! \d) matches '1234' 'x1234' '1234x' 'x1234x' but none of '12345' 'x12345x' etc. Extend this to (?<! \D) and (?! \D) and you have a sometimes-useful double-negation asserting "non-digit boundary".
Give a man a fish: <%-{-{-{-<
In reply to Re^7: Regex help \b & \Q
by AnomalousMonk
in thread Regex help \b & \Q
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |