-
-
Save emiliojva/58ca4332ca238f858f7867913308cde8 to your computer and use it in GitHub Desktop.
Validações em Expressões Regulares no Javascript regex js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Data e hora dd/mm/yyyy hh:mm | |
var data = "01/01/2000 12:00:00".match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/[0-9]{4} (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$/); | |
console.log(data); | |
var email = "[email protected]".match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/); | |
console.log(email); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment