Description |
Removes invalid or broken HEX and HTML entities from string.
These will not be matched since they are valid:
€
€
These will be matched since they are invalid entities:
&
&eu
&;
&#
S
Especially handy in case a string is being manipulated using e.g. substring, which may break entities in either the beginning or end of the string.
One might consider using ^ and $ to make it match only beginning and/or end of string.
http://regex101.com/r/pM9dE5/16 |