Answer the question
In order to leave comments, you need to log in
Why doesn't the regex work?
string pattern = @"\d{3}(-XX-)\d{2}(/)(?:\d{5}|\d{7})";
string value1 = @"111-XX-99/12345";
string value2 = @"111-XX-99/1234567";
var rez1 = Regex.IsMatch(value1, pattern);
var rez2 = Regex.IsMatch(value2, pattern);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question