Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my regex: @"[^A-Za-z0-9!@$%&*()-=;:'"",.?/\s\[\]]"

and i am doing to remove invalid characters from a string but only plus[+] sign is left.

This is my testing string :
"123!@#$~`abAB~`!@$Now!@$%&*()-=[];:',.?/+"<br />

and output is: 123!@$abAB!@$Now!@$%&*()-=[];:',.?/+

Expected Result : 123!@$abAB!@$Now!@$%&*()-=[];:',.?/

I want to skip the plus[+] sign too. plz help me.
Posted
Updated 7-Oct-15 2:56am
v6

1 solution

Minus indicates a range...
Try:
@"[^A-Za-z0-9!@$%&*()\-=;:'"",.?/\s\[\]]"
 
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