Problem: To find valid e-mail.
A valid e-mail has a prefix name and a domain where:
The prefix name is a string that may contain letters (upper or lower case), digits, underscore '_', period '.', and/or dash '-'. The prefix name must start with a letter. The domain is '@leetcode.com'.
when I'm using following expression it's working fine
'^[a-zA-Z][a-zA-Z0-9\.\_\-]*@leetcode[\.]com$
but
the second expression is not matching to strings with '_'(underscores)
'^[a-zA-Z][a-zA-Z0-9\.\-\_]*@leetcode[\.]com$'
testcase: '[email protected]
using mysql
as per my understanding both of the regex should give same output but the first one is matching with testcase containing underscores and second one is not