piighost/us-phone
US phone number, optional +1 prefix and parentheses, then 3-3-4 digits. A lookbehind anchors before a leading + or (, which \b would miss, and a lookahead stops a trailing digit run. The area-code parentheses are paired, so a number written inside parentheses does not swallow the opening one.
Label: US_PHONE
Pattern (?<![\w+])(?:\+?1[\s.-]?)?(?:\([2-9]\d{2}\)|[2-9]\d{2})[\s.-]?\d{3}[\s.-]?\d{4}(?!\d)
Must be caught Call +1 (415) 555-0123 before noon. → +1 (415) 555-0123Office: 415-555-0123 → 415-555-0123Cell (415) 555-0123 → (415) 555-0123
Must be left alone Call 115-555-0123 now555-0123
Tags: us, contact
Download the detector as TOML
Used by
piighost/us — the United States: phone, ZIP code, the individual taxpayer number and the social security number.
Related patterns
piighost/ar-phone — Argentine phone number, the +54 country code or the 0 trunk prefix then ten or eleven digits.
piighost/ar-postal — Argentine CPA postal code: a province letter, four digits for the town, then three letters for the block side.
piighost/at-phone — Austrian phone number, the +43 country code or the 0 trunk prefix then six to thirteen digits, since Austrian…
piighost/au-phone — Australian phone number: the +61 or leading 0 prefix, a single area or service digit, then eight digits.
piighost/au-postal — Australian postal code, anchored on the state or territory abbreviation that precedes it in an address.
piighost/be-phone — Belgian phone number, the +32 country code or the 0 trunk prefix then eight or nine digits.
← piighost/us-passport · All patterns in the catalogue · piighost/us-ssn →