Regex to detect hyphen character

Viewed 629

Live demo: http://regex101.com/r/wW6wC4


I'm trying to add a regex expression that allows email addresses like:

asdf.asdf@test-dom-a.com

([\w+\.]+@[\w]{1,})(\.)([0-9a-zA-Z\.\-]{1,})
                                     ^---- Thought this would allow hyphens...

what am I missing here?

4 Answers
Related