I need to match & which is present in plain text but it should not capture the & from entities like i
e.g.,
hi this is a plain text containing & and the entity E , & and &
In the above text I should find only & which is in text–i.e., coming after containing.
I tried this pattern &[^#x]* but I couldn’t get all matches.
The stolen regex to match HTML entities from another answer combined with look-aheads:
Shortened:
Explained:
We want to match
&but not&123;etc.