0

I need to validate English / Arabic letters only with spaces in a textbox. I used below validation expressions, it accepts English / Arabic text, But it did not accept any spaces. Can anyone give me the right expression.

^[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z]+[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z-_]*$
rene
  • 41,474
  • 78
  • 114
  • 152
Arwa
  • 3
  • 7

1 Answers1

0

It is called a Regular Expression. To allow whitespaces, you need to add a whitespace to the set.

^[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z-_ ]+$

This Regular Expression accepts English, Arabic letters and whitespaces. It also accetps only whitespace with no letters.

3li
  • 598
  • 3
  • 13
  • yes dear I'm taking about the validation expression of a regular expression. I used this ( ^[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z]+[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z-_\ ]*$ ) and it works fine for me. @3li – Arwa Jul 17 '19 at 08:55