Hello everybody,
A RegEx has an IgnoreCase option, does a match have one ?
To find the number of letters in a characters string, I did it this way :
Regex rgx = new Regex("[a-z]");
Regex Rgx = new Regex("[A-Z]");
Console.WriteLine(rgx.Matches(message).Count + Rgx.Matches(message).Count);
I wonder whether there is better.
(and I wonder why the beginning of my question is written in bold.)
This question is common to most languages dealing with regex, not limited to C#
You can write regex like this:
“[A-Za-z]”
Or: Regex rgx = new Regex ("[a-z]", RegexOptions.IgnoreCase);
Oh, two good answers for the price of one
Thank you.
A question of thinking correctly indeed …
(I presume nobody has any tip about why my first sentence was in bold until I got answers.)
I fixed the format of your post
Ah, OK, some bugs being fixed ?
I wondered whether I had to do a manipulation …
it was just an additional blank like to add before the code section.