Using Java regex pattern I want to match the &
symbol. But it should not match &
, <
etc... (HTML encoding).
Try this:
&(?![A-Za-z]+;|#[0-9]+;)
This matches an &
that's not followed by one or more ASCII letters and a ;
or a hash symbol, followed by one or more ASCII digits and a ";".