Skip to content

Instantly share code, notes, and snippets.

@wiltonbsilva
Created June 14, 2014 10:26
Show Gist options
  • Save wiltonbsilva/f53a58d374df51f72fd9 to your computer and use it in GitHub Desktop.
Save wiltonbsilva/f53a58d374df51f72fd9 to your computer and use it in GitHub Desktop.
Regular Expression to match Brazilian (cell)?phone numbers
RegEx:
(^|\()?\s*(\d{2})\s*(\s|\))*(9?\d{4})(\s|-)?(\d{4})($|\n)
Test:
11957375429
Test:
11 976546863
11 976542345
11 97654 9753
(11) 98765 1234
(11)968785324
(11)95676-7654
(11) 98754-6694
(11)5678 1334
(11) 4567 1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment