Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
Hi,

I need a regular expression in C# for accepting only special characters. my requirement is to detect that,if entered chars are special characters or not.If all the entered characters are special characters like @,#,$,%.etc..i need to implement some logic there.


Thanks,
Posted
Updated 13-May-13 3:10am
v2
Comments
joshrduncan2012 13-May-13 9:21am    
Have you tried googling for a regular expression checker? Your question is great for google.
Sergey Alexandrovich Kryukov 13-May-13 10:38am    
"Etc." makes no sense here. How the characters you listed are "special"? What are others? "etc." is not helpful...
—SA

1 solution

Try:
^\W+$
 
Share this answer
 

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