If my input string is ~!@#$%^&*()_+{}:\"<>?
How do I get the count of each special character using Regex? For example:
Regex.Match
This should be the answer to your question:
Regex.Matches("Little?~ birds! like to@ sing##", "[~!@#$%^&*()_+{}:\"<>?]").Count
Count should return 6 matches, change the sentence to other variable or something else.
You can find more info about regex expressions here: http://www.zytrax.com/tech/web/regex.htm
Best Regards!