Page 1 of 1

Regular expression for email

PostPosted: Tue May 17, 2022 1:27 pm
by martin@.....cz
Hi. I try setup regex for email. And not work.
I used Regex Generator for any regular expression. For email all dont work, because other regular expression replace it. Cart use one Regular expression like "use any words and @" thats all. All my overtures are replace.
Even the one that works for the phone number pattern="^\d{9}$" is outvoted by something else. I suspect Virtuemart does it directly. But I didn't find anything in the customer fields :(

Re: Regular expression for email

PostPosted: Fri Nov 25, 2022 4:49 pm
by admin
hello, email is a special field which has it's own validation (and/or regex)

for all other fields:
- regex is either based "per country"
- or is globally set including pattern

i.e.:
global config (html 5 pattern):
Code: Select all
pattern="[0-9]{5}"


per country config (netherlands):
Code: Select all
[1-9][0-9]{3}\s?[a-zA-Z]{2}|[1-9][0-9]{3}[a-zA-Z]{2}


it can be used for phones or other inputs (but not email) same way - it has to meet HTML5 regex specifications.

best regards, stan