Skip to main content
Inspiring
April 7, 2010
Question

Simple regex Tweak & E-Mail Address Validation

  • April 7, 2010
  • 1 reply
  • 409 views

I have the following regex validating E-Mail addresses for me:

<CFIF refind("^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(([A-Za-z]{2,3})|(aero|coop|info|museum|name))$", attributes.email_address) EQ 0>
<CFSET request.error = listappend(request.error, "#attributes.return_error#", ",")>
</CFIF>

Problem is it's denying E-Mail addresses with a period (.) just before the at symbol (@), such as:

john.@doe.com

regex isn't my strong suit, can anyone help me with this one?

Thank you in advance.

    This topic has been closed for replies.

    1 reply

    Inspiring
    April 7, 2010

    ColdFusion has an isValid() function available that you can use instead of regex.