Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need a regular expression that dosn't allows ~ and : symbols


What I have tried:

i tried this "^((?!~).)*$"
but it only checks for ~ symbol.
i wants to prevent both symbols ~ and :

quick help is needed.
Thanks in advance.
Posted
Updated 6-May-16 3:07am
v2
Comments
Mohibur Rashid 6-May-16 8:56am    
allow from what?

1 solution

Try:
^[^:~]*$
 
Share this answer
 
Comments
FireMonkey018 6-May-16 9:31am    
it works ...!!
Thanks #OriginalGriff
OriginalGriff 6-May-16 9:40am    
You're welcome!
If you are going to use Regexes, then get a copy of Expresso

http://www.ultrapico.com/Expresso.htm

It's free, and it examines and generates Regular expressions. I wish I'd written it!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900