Skip to content

Instantly share code, notes, and snippets.

@roberto-filho
Created February 13, 2015 15:58
Show Gist options
  • Save roberto-filho/d339458f4227651c3820 to your computer and use it in GitHub Desktop.
Save roberto-filho/d339458f4227651c3820 to your computer and use it in GitHub Desktop.
// Remove tudo que não for dígito ou /
"ab1s/3hae/2s1h".replace(/[^\/|\d+]/g, "")
// Matches a date pattern
"01/02/2014".match(/^(\d{1,2}\/){2}(\d{2}){1,2}$/g) // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment