Forums

Full Version: Regular expression for valid name and email
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to write regular expression pattern for valid name and email?

var myRe = /^([C][F])+-[A-Z]{2}-[A-Z]{3}-\d{3}$/ ;

var result_id=myRe.test(fleet_id);
var myEmail = /^(([^<>()\[\]\\.,;:\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,}))$/;