Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
^[ ]*(?:(?:\+)?1)?[ ]*(\()?(?:[2-9][0-9]{2})(?(1)\))[ ]*(?:-|\.)?[ ]*(?:[2-9][0-9]{2})[ ]*(?:-|\.)?[ ]*[0-9]{4}[ ]*$
"
gm

Description

Submitted by Nishant Misra - 3 years ago (Last modified 3 years ago)