12-23-2022, 10:49 AM
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,}))$/;
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,}))$/;