Basically, I want to count sets of specific characters in a string. In other words, I need to count all the letters and numbers, and nothing more. But I can not find the correct (regular) syntax. Here is what I have ...
public double AlphaNumericCount(string s) { double count = Regex.Matches(s, "[AZ].[az].[0-9]").Count; return count; }
I look around, but I donβt seem to find anything that allows for more than one character set. Again, I'm not sure about the syntax, maybe it should be "[AZ] / [AZ] / [0-9]" or something. Anywho, come to me - his first day with Regex.
Thanks.
Sizza source share