Created
July 4, 2012 00:20
-
-
Save leodutra/3044325 to your computer and use it in GitHub Desktop.
Basic Latin-1 Letter Regular Expression (JavaScript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(/[A-z\u00C0-\u00ff]+/g) |
This fail for ][ characters.
I'm using the following RegExp to find and remove all characters that are NOT defined in ISO/IEC 8859-1:
/[^\u0020-\u007e\u00a0-\u00ff]/g
^ for NOT, g for all occurences (global search)
I found the range on Wikipedia:
https://en.wikipedia.org/wiki/ISO/IEC_8859-1
https://en.wikipedia.org/wiki/Unicode#Standardized_subsets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for that!