Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Simple regex Tweak & E-Mail Address Validation

Participant ,
Apr 07, 2010 Apr 07, 2010

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.

369
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 07, 2010 Apr 07, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources