jqs
jqs

Reputation: 82

regex to exclude certain special characters

I am looking for a regex...I am validating it 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.

Upvotes: 0

Views: 5359

Answers (2)

agent-j
agent-j

Reputation: 27913

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

Upvotes: 0

Town
Town

Reputation: 14906

^[^÷çþ]+$

Use it like this: Demo.

Upvotes: 3

Related Questions