I want to validate email inputs on my app with regex in Angular. But there is a problem, I want a multiple email validation with regex that user just can enter the email like that
Examples:
*****@zigurat.com
*****@test.com
*****@partlastic.com
**** can be anything but after @ required with multiple email like UP
can you help me with multiple email validation in Angular with regex
thanx a lot
CodePudding user response:
You can test against multiple fixed domains using the following construction
^[a-zA-Z0-9.!#$%&'* \/=?^_`{|}~-] @((zigurat\.com)|(test\.com)|(partlastic\.com))$
The part in front of the @
follows the JavaScript- and Perl-compatible regular expression for email addresses.