0

Something like testuser@test.local should be a match. The regex I use is:

\w[\w\.\- ]*$/@/^[a-zA-Z][a-zA-Z0-9\-\.]{0,61}[a-zA-Z]

What did I miss?

It's not like an E-Mail because it can be many sublevels in the domain e.g. test.local.country.city.street

Thypari
  • 801
  • 1
  • 6
  • 22

1 Answers1

0

You should also define, where in the text that address can appear. But if the address is on a separate line, then:

^[\w]+\@[\w]+\.[^\d\W]+$

The test is here.

If you want to accept complex names and domains of level above second, too, then:

^[\w]+(\.[\w]+)*\@[\w]+(\.[\w]+)*\.[^\d\W]+$
Gangnus
  • 24,044
  • 16
  • 90
  • 149