how to read only english characters
Posted
by
ralph
on Stack Overflow
See other posts from Stack Overflow
or by ralph
Published on 2010-12-30T13:47:40Z
Indexed on
2010/12/30
13:54 UTC
Read the original article
Hit count: 156
I am reading a file that sometimes has chinese and characters of languages other than english.
How can I write a regex that only reads english words/letters?
should it just be /^[a-zA-Z]+/
?
If I do the above then words like eété
will still be picked but I don't want them to be picked:
"été".match(/^[a-zA-Z]+/) => #nil good I didnt want that word
"eété".match(/^[a-zA-Z]+/) => #not nil tricked into picking something i did not want
© Stack Overflow or respective owner