It would be awesome if you could share some cool Regexes that you use more often than not.
The one that I keep constantly bumping into, is the one for validating emails.
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\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,}))$/;
return re.test(email);
}
Excited for the answers; more so to update my stash of Regexes. :)
No responses yet.