Skip to content

Instantly share code, notes, and snippets.

@liperuf
Last active May 20, 2016 14:18
Show Gist options
  • Save liperuf/f36c830c2f481692d7f10bd96dc77229 to your computer and use it in GitHub Desktop.
Save liperuf/f36c830c2f481692d7f10bd96dc77229 to your computer and use it in GitHub Desktop.
Collection of my best regular expressions

Tested at http://regexr.com/ and https://regexper.com

Tests for zip code (Brazil) fake-but-acceptable format

^([0-9])\1{4,}\-?\1{3}$

  • 00000-000 // true
  • 12345-678 // false
  • 33333-333 // true
  • 00000-001 // false
  • 0000000 // true
  • 1000000 // false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment