Regular Expressions 101

Community Library Entry

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 - 2 years ago