I'm trying to write some regex to match everything apart from a symbol (well two symbols actually). I can get it working on regex101 but when written in PHP it doesn't seem to work correctly.
I want to match anything other than say £ or $.
I've tried this: /[^£$]/g
but that only seems to match if the symbol is at the beginning of the string. I've tried so many combinations, tried escaping characters anchoring to the end which has worked a bit better but then it wouldn't catch something like this£inside.
What am I doing wrong?