This site uses cookies. By continuing, your consent is assumed. Learn more

139.3fm shares

Validating email address with regular expression examples

opinion
Advanced Search

You have a form on your website or a dialog box in your application that asks the user for an email address. You want to use a regular expression to validate this email address before trying to send email to it.

This reduces the number of emails returned to you as undeliverable. This first solution does a very simple check. It only validates that the string contains an at sign that is preceded and followed by one or more nonwhitespace characters.

News feed