Skip to content

Commit 0e4e2ce

Browse files
committed
Fix -s in Regex PhoneNumber validation
1 parent 057b2ae commit 0e4e2ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/KSFramework/Utilities/ValidationExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static bool IsValidEmail(this string email)
2222

2323
public static bool IsValidMobile(this string phone)
2424
{
25-
return Regex.IsMatch(phone, @"(?:(?:\+|00)?\d{1,4})?[-\s\.]?(?:0)?\d{6,14}");
25+
return Regex.IsMatch(phone, @"^(?:\+?\d{1,3}[.\-\s]?)?(?:\(0?\d{1,4}\)|0?\d{1,4})?[.\-\s]?\d{1,4}[.\-\s]?\d{1,9}$");
2626
}
2727

2828
}

0 commit comments

Comments
 (0)