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

  • SEARCH
  • Home
  • 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 9237941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:38:47+00:00 2026-06-18T07:38:47+00:00

I got a bugged regex \w+([\.\-]?\w+)*@ when it try to test whether it matchs

  • 0

I got a bugged regex "\w+([\.\-]?\w+)*@"
when it try to test whether it matchs a string

"ffffffffffb3ffffffffffafffffffffffabffffffffffc2ffffffffffa7e"

it will cause IE and Chrome hung up. But works fine by FF.

I found out that the “?” in the regex is not necessary. And it works find after I remove the “?”.

But here is what I don’t understand what cause the problem.
Here is some test

  1. "\w+([\.\-]?\w+)*" works fine.

  2. "\w+([\.\-]\w+)*@" works fine.

  3. "\w+([\.\-]?\w+)*@" cause the problem

Anyone knows why? or it’s just the performance between browsers.

  • 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-06-18T07:38:48+00:00Added an answer on June 18, 2026 at 7:38 am

    This is called catastrophic backtracking.

    In your third example, the @ (which obviously causes the regex to fail) forces your regex engine to try all possible permutations of \w+(\w+)* (since the character class is optional). With a string of this length, the calculations would take longer than until the heat death of the universe.

    RegexBuddy Screenshot

    Firefox appears to have an iteration limit on regexes and will abort after about a million attempts, Chrome and IE seem to be a bit more stoic here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got the following simple query which works fine through phpmyadmin but when I add
Got a Jsfiddle where I have a textarea which fills a table cell. But
Got this warning when I check whether the credit card number is valid or
Got this error today while trying to build a project with checkstyle. This works
Got it from php.net, but I am not sure is this how everybody destroy
Got this ScopeExit class off code-project but it would not build on GCC 4.5.3.
Got my Rails app all beautified with Twitter Bootstrap but I think I'm missing
I got the following crash report from iTunesconnect. Is the UIActivityIndicatorView bugged? Date/Time: 2009-09-26
I installed GNUStep http://www.gnustep.org/experience/Windows.html but when compiling helloworld.m I got libgmp-10.dll missing. What should
Got Phonegap working, but not seeing the staticmap.png image for your current location <div

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.