Skip to content

Instantly share code, notes, and snippets.

@leodutra
Created July 4, 2012 00:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leodutra/3044325 to your computer and use it in GitHub Desktop.
Save leodutra/3044325 to your computer and use it in GitHub Desktop.
Basic Latin-1 Letter Regular Expression (JavaScript)
(/[A-z\u00C0-\u00ff]+/g)
@christophemarois
Copy link

Thanks for that!

@celorodovalho
Copy link

This fail for ][ characters.

@bjtb
Copy link

bjtb commented Jul 31, 2018

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