Please refer below code.
C#
if (System.Text.RegularExpressions.Regex.IsMatch(txtNumber.Text.Trim(), @"^1[\s]?(800)?[\s\-]?\d{3}\-?\d{4}$"))
{
// this will be valid if phone is 1 800 333-4453
// this will be valid if phone is 1 800333-4453
// this will be valid if phone is 1800333-4453
// this will be valid if phone is 18003334453
// If you want mandatory space and hyphen in number then use below regex
// "^1[\s]?(800)[\s]\d{3}\-\d{4}$"
}
VB
If System.Text.RegularExpressions.Regex.IsMatch(txtNumber.Text.Trim(), "^1[\s]?(800)?[\s\-]?\d{3}\-?\d{4}$") Then
' this will be valid if phone is 1 800 333-4453
' this will be valid if phone is 1 800333-4453
' this will be valid if phone is 1800333-4453
' this will be valid if phone is 18003334453
' If you want mandatory space and hyphen in number then use below regex
' "^1[\s]?(800)[\s]\d{3}\-\d{4}$"
End If
I hope this will help you out.