The top one is reasonably fast, the bottom one is slow, but works for all patterns./^(?:[^f]+|f(?!oo))*$/; # Matches strings not containing 'foo'. /^(?:(?!PATTERN).)*$/; # Matches strings not containing PATTERN +.
Abigail
In reply to Re: How do I write a regex for 'does not contain' a string.
by Abigail-II
in thread How do I write a regex for 'does not contain' a string.
by IraTarball
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |