1. bec00l
  2. Support
  3. Friday, July 18 2014, 04:44 AM
I try to set up validation of field be regular expression [a-zA-Zа-яА-Я0-9\-\ ]{3,100}
it works fine with english, but not works with russian.

it's not valid with any russian word

site is in UTF-8
admin Accepted Answer
Admin
Hi,
we use PHP preg_match for regular expression, so to validate Cyrillic char you can use \p{Cyrillic}

I think the correct way is:
[a-zA-Z0-9\p{Cyrillic}\-\ ]{3,100}


Sorry but I have not tested this :(
References
  1. http://itworkarounds.blogspot.it/2011/08/validating-cyrillic-utf8-alphanumeric.html
  1. more than a month ago
  2. Support
  3. # 1
bec00l Accepted Answer
Content Protected
  1. more than a month ago
  2. Support
  3. # 2
admin Accepted Answer
Admin
try with this: [a-zA-Z\p{Cyrillic}0-9\-\ ]{3,100}

I apologize if I'm going to attempt but unfortunately I do not have much experience with regular expressions. :(
  1. more than a month ago
  2. Support
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.