Your regex should be like this
^(\d{1}-){0,1}\d{3}-\d{3}-\d{4}$
to allow it to capture mentioned two pattern and not any others. Please let me know if it helps you.
//String input = "888-456-5678";
String input = "1-888-456-5678";
String sPattern = @"^(\\d{1}-){0,1}\\d{3}-\\d{3}-\\d{4}$";
Regex o = new Regex(sPattern);
Match m= o.Match(input);
if (m.Success)
{
MessageBox.Show("Match found.");
}
else
{
MessageBox.Show("No match");
}
Thanks, Arindam D Tewary