61
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.

2021-02-02 11-55-27
Tushar Panpaliya

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.