Hi,

I'm trying to write/find a regular expression for finding ampersands but not HTML entites

I have this which finds entities but can't quite figure out how to ignore entities and return unmatched "&"

Code:
&[^\s]*;
Test string:
Code:
This is sample test containing a bunch of & and entities. Do you shop at: M&S? &x#1234;
I want to html encode the non-entity ampersands e.g.
"bunch of & and" --> "bunch of & and"

Any help will be greatly appreciated

Cheers Al