I want to create a regex
to match one or two digit
s, followed by the character
"M", followed by two digits
, and then matching anything else, but it doesn't quite work:
I have this regex
pattern:
string astring = "3M90-75";
string sPattern = "^\\d{1}M\\d{2}}$";
if (System.Text.RegularExpressions.Regex.IsMatch(astring, sPattern))
{
//It's a match.
}