By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,449 Members | 972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,449 IT Pros & Developers. It's quick & easy.

Regex to validate letters, spaces and unicode characters

P: 2
Hi,

Could you guys help me to add this pattern: `[\u0000-\u0080]`
into the following regex: `/^[a-zA-Z\ \']+$/` ?

The above regex allows only letters and spaces, and I would like it to additionaly allow text if it has the above unicode pattern also (but its not required).

Regards.
Oct 15 '12 #1

✓ answered by Dormilich

then you would need to extend the character class beyond \u0080.

Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
there’s no need to combine the first and the second RegExp. the second is already a part of the first (ASCII).
Oct 15 '12 #2

P: 2
I dont think so, the
Expand|Select|Wrap|Line Numbers
  1. /^[a-zA-Z\ \']+$/
will pass such words like "Test test" or "test Test", but IT WOULDNT pass special characters (unicode) like "Łądsc Ęsć" .. and I would like to allow that too.
Oct 15 '12 #3

Dormilich
Expert Mod 5K+
P: 8,639
then you would need to extend the character class beyond \u0080.
Oct 16 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.