I have a long list of regular expressions for various form fields I'm checking. My question is, if I want to apply two or more of these RE's to one of these fields, how do I go about doing that? Thanks.
Well... probably best to nest them (without knowing anything more about the scenario)...
Code:
if (regExp1.test(myString) && regExp2.test(myString)) {
// both regexp patterns returned true
} else {
// one (or both) regexp patterns returned false
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.