I am trying to validate ‘words’ with Ruby 1.8.7.
My regex to catch a word is currently:
/[a-zA-Z]\'*\-*/
This will only catch English words; Is there a way to catch non-English UTF-8 characters?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Even the 1.8.x Regex engine is UTF-8 aware, you just need to use the right expression, and it’s slightly more than just using
/\w/:and you get: