IT Genesis
asked on
Regular express validation
I need validation expression only Arabic character and Three names
ASKER
yes two spaces i try to use thtis \w+ \w+ but not work
When using a pattern for validation purposes, you usually need to add start and end of string placeholders (^ and $) to ensure no additional characters exist before or after the characters matched by the pattern.
eg the pattern ab?d would match the value abcde but pattern ^ab?d$ would not match it.
So for 3 words separated by a space character you might want to try pattern:
eg the pattern ab?d would match the value abcde but pattern ^ab?d$ would not match it.
So for 3 words separated by a space character you might want to try pattern:
^\w+ \w+ \w+$
ASKER
yes but it run with English character only no different language
Then you could use this:
^[a-zA-Z]+ [a-zA-Z]+ [a-zA-Z]+$
Or the same thing, but shorter:^([a-zA-Z]+ ){2}[a-zA-Z]+$
ASKER
it also work with English letter
Sorry, you'll need to better explain what the problem is.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@Terry Woods
Thanks for your help
Thanks for your help
Do you mean you want to match?
Open in new window
but notOpen in new window