Last active
November 4, 2020 13:36
-
-
Save germanattanasio/84cd25395688b7935182 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
var regexp = /^[A-z\u00C0-\u00ff\s'\.,-\/#!$%\^&\*;:{}=\-_`~()]+$/, | |
ascii = ' hello !@#$%^&*())_+=', | |
latin = 'Panamá, ratón, cortés, árbol, azúcar, ángel', | |
chinese = ' 你 好 '; | |
console.log(regexp.test(ascii)); // true | |
console.log(regexp.test(latin)); // true | |
console.log(regexp.test(chinese)); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment