in reply to using regex to not match a string
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
|
|---|