Commonly Used Regex Strings

Here are some example Regex strings:

Format

Matching string

Social Security number

\d{3}-\d{2}-\d{4}

Phone number

((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}

ZIP code

\d{5}(-\d{4})?

Email address

[\w-]+@([\w-]+\.)+[\w-]+

Internet URL

http://([\w-]\.)+[\w-](/[\w- ./?%=]*)?

Credit card

\d{4}-?\d{4}-?\d{4}-?\d{4}


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label