I want an regex for email that starts with numbers and letters.
My regex is
/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/
What is wrong in this? It allows ._-
from start and in between. But I don't want this
Valid emails = s@gmail.com
, s.p@y.com
, s_p123@g.com
Invalid emails = ....s@g.com
, s---g@g.com
, s...@g.com
, 44s..p@g.com
, ----s@g.com
Does anyone know how this can be done?