Using Regex to validate E-mail and Phone Number

1 · Subin Siby · Jan. 26, 2013, 8:45 a.m.
Here is the RegEx expression to validate Phone number and E-mail. RegEx expression for validating E-mail : /^(([^<>()[].,;:[email protected]"]+(.[^<>()[].,;:[email protected]"]+)*)|(".+"))@(([[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,}))$/ and the RegEx expression for validating Phone number : /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/ Here is an example of usage of these RegEx expressions in JavaScript. var emailregex=/^(([^<>()[].,;:[email protected]"]+(.[^<>()[].,;:[email protected]"]+)*)|(".+"))@(([...