Oops. Didn't notice the ; at the end of the pattern you want to avoid.
What Tanktalus said: /&(?!amp;)/ .
The above will match &, &foo, &ersand, but not & followed by a \W character or by the end of the string. If you don't want to match &, irrespective of what follows it, then use/&(?!amp\b)/
See ?! in perlre./&(?!amp)/
the lowliest monk
In reply to Re: using regex to not match a string
by tlm
in thread using regex to not match a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |