I need to verify input which is like en-US or en-us or ar-AE
I have searched net and found it bit difficult to understand and create one regular expressing on string which is no more than 5 characters in length and should be case in-sensitive.
I created one [a-z][a-z][-][a-z][a-z] this one works fine but it doesn’t check the length
it will match en-USXYZ also
Regards
You use
^and$to specify the start and end of the string.Or using multiplier:
You would also have to include the
A-Zinterval for upper case characters, unless you have specified case insensetivity for the Regex object: