Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2021-11-12 05:42
Flavor·Python

r"
(?:[\r\t\f\v ]*)(\(?[0-9]{3}\)?[-.● ]?[0-9]{3}[-.● ]?[0-9]{4})(?:\s*)
"
mg
Open regex in editor

Description

Pulls US phone numbers from anywhere in a string of text regardless of separator or beginning parenthesis

Submitted by anonymous