Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:49:20+00:00 2026-05-24T08:49:20+00:00

I have the following email address validator, which won’t evaluate and throws the above

  • 0

I have the following email address validator, which won’t evaluate and throws the above error when the string to evaluate hits a certain length:

^([\w\-]+)([\.\w\-\+]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$

It’s easy to reproduce. Drop the regex into http://regexpal.com/ along with a long email address such as juicy.cakeballs2@cheeze-party.poonalicious.com

The problem is specific to Firefox 4+

Can anyone suggest perhaps a way to simplify the regex or some other way to address the problem?

It’s tearing me apart, Lisa!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:49:21+00:00Added an answer on May 24, 2026 at 8:49 am

    The problem is with the overlapping classes. [ab]+[abc]+ can match “ababababc” a number of different ways. To reduce backtracking, refactor it to something like [ab]+(c[ab]*)* instead. (I know, the refactored expression doesn’t match exactly the same strings as the original expression. Too lazy to post a proper example. Google “regex backtracking”, no, buy and read Friedl, now).

    For the record, forms which want to “validate” my email address in JavaScript fail most of the time. I can’t count how many times I had to create a temporary email address just in order to be able to complete a purchase or subscription. The only reliable way to validate an email address is to attempt to send email. Please don’t create yet one more broken form “validator”.

    Some example addresses which are technically valid:

    *@example.com
    me@had.to.create.a.temp.address.again.i.run.my.own.dns.example.net
    you.forgot@domain.example.museum
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following syntax in my script to get email address from string. The
I have the following: public class Address { public string Email { get; set;
I have the following Regular Expression which matches an email address format: ^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$ This
I have the following code, which, upon the press of a certain button, should
I have the following code to generate an input field for user's email address
I have the following email-validator in my javascript, but the @ is getting misinterpreted
I have following condition: How do I send email to example@mail.com on submitButton clicklistener
I have the following function sending an email twice (and I believe running if($result)
I have the following code import smtplib from email.mime.text import MIMEText smtpserver = 'smtp.gmail.com'
I have the following classes: Public Class Email Private Shared ReadOnly EMAIL_REGEX = \b[a-zA-Z]+[a-zA-Z0-9._+-]+@

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.