What is the regular expression to match any email address in a string?
Answer options
A
[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
B
[a-z]+@[a-z]+
C
\w+@\w+
D
[\w.-]+@[\w.-]+
Correct answer: [a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
Explanation
A comprehensive email regex checks local part, @ symbol, domain, and TLD.