two different patterns in the same HTML input

2

Hello, I would like to know if there is a way to put more than one pattern as an alternative to the first one in html

For example, a person can only use Gmail.com and Hotmail.com, so that they can fill in with an OU other

ex:

<input type='text' pattern='[A-Za-z0-9._%+-][email protected]'>
    
asked by anonymous 08.08.2016 / 18:10

1 answer

6

You can not add more than one regex in the pattern attribute, what you can do is add a group containing what you want.

<input type='text' pattern='[A-Za-z0-9._%+-]+@(gmail|hotmail).com'>
    
08.08.2016 / 18:18