Regular Expressions 101

Community Patterns

1...34567...881

Phone number for all countries

2

Regular Expression
.NET 7.0 (C#)

@"
^(?<code>\+?\d{1,3})[-\s]{0,}(?<number>\(?\d{3}\)?[-\s]{0,}\d{3}[-\s]{0,}\d{2}[-\s]{0,}\d{2})$
"
gm

Description

Phone number for all countries. Valid symbols: ( ), -, whitespace

Submitted by Alexander Smirnov - a year ago