开发者

regex to exclude certain special characters

开发者 https://www.devze.com 2023-03-14 16:44 出处:网络
I am looking for a regex...I am validating i开发者_开发问答t on the client-side(javascript) accepts all characters/number and all other special charaters except 3 special characters such as \'÷\' ,

I am looking for a regex...I am validating i开发者_开发问答t on the client-side(javascript)

accepts all characters/number and all other special charaters except 3 special characters such as '÷' , 'ç' and þ. I am just a beginner please help.


^[^÷çþ]+$

Use it like this: Demo.


Find the unicode number for these characters (using your debugger to cast them to an int, or using a program called charmap.exe). The division symbol looks like F7 in hex. Then, you can use this format for your regex:

\u00F7
0

精彩评论

暂无评论...
验证码 换一张
取 消