Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML pattern for email to a specific domain

Tags:

regex

I'm trying to find a regex pattern that only accepts email with a specific domain as follows.

z= [a-zA-Z0-9]

y= [a-zA-z]

(1) [email protected] (eg: [email protected], [email protected])

(2) [email protected] (eg: [email protected], [email protected])

Currently what I have so far is: [.a-zA-z0-9]*@domain.[a-zA-z0-9]

Could anyone help me on this?

like image 410
ApplePie Avatar asked Dec 06 '25 07:12

ApplePie


1 Answers

Here you are for request no 1

^[a-zA-Z0-9]+@domain\.[a-zA-z]+$

for request no 2

^[a-zA-Z0-9]+@[a-zA-Z0-9]+\.domain\.[a-zA-z]+$
like image 173
Ares Avatar answered Dec 07 '25 22:12

Ares