12
Views
1
Comments
Regex for validation text/String.
Question

Hi All,


I wan't to validate a string by ascii code,range is 65 to 122 and 192 to 255.

Can anyone tell me how to create this validation?


Thanks in advance :)

Dhiraj M.

You can use something like this maybe :  [\x41-\x7A]|[\xC0-\xFF]


It will try to match individual chars in the hex range. For ASCII to hex conversion refer to : https://www.ascii-code.com/ 


To quickly test your regex for various inputs use https://regex101.com/ and then just modify the regex till it fulfills all your criteria.


Cheers,

Tushar