I have two validation scripts which work in their own right, but I now want to make a text box validate the content to either be one or the other – in this case an email address or a 10 digit number.
I have the following…
^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$
^[a-zA-Z0-9]{1,10}$
I want to merge these into a single either/or validation expression.
You can join two or more regex with the
|“or” operatorCheck a test here