Regex for phone number (E.164)
/\+[1-9]\d{6,14}\b/g
Matches
Examples
Note
E.164 is a + then up to 15 digits with no spaces, the format to store numbers in.
Matches in the example
"+14155552671""+442071838750""+819012345678"
Token by token
\+the character “+”[1-9]one of: “1” to “9”\d{6,14}a digit (0–9), between 6 and 14 times, as many as possible\ba word boundary
Other patterns
- Email address
- URL
- IPv4 address
- UUID
- Hex color
- Date (YYYY-MM-DD)
- Time (24-hour)
- US phone number
- Phone number (E.164)
- US ZIP code
- Credit card number
- URL slug
- Username
- Strong password
- HTML tag
- Semantic version
- MAC address
- JSON Web Token
- Hashtag
- @mention
- Number
- Leading and trailing whitespace
- Repeated word
- Blank lines
- Markdown link
- Quoted string
- Domain name
- File extension
- Base64
- Trailing comma