Displaying page
of
pages;
Items to
Title |
Test
Details
Remove broken HEX and HTML entities
|
Expression |
/&(?!\w+;|#\d+;)\S*/g
|
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
|
Matches |
& | &eu | &; | &# | S
|
Non-Matches |
€ | €
|
Author |
Rating:
Not yet rated.
Jimmy
|
Displaying page
of
pages;
Items to