Bug 31719 - Bad performance with simple expressions
Summary: Bad performance with simple expressions
Status: CLOSED DUPLICATE of bug 9153
Alias: None
Product: Regexp
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC other
: P3 normal (vote)
Target Milestone: ---
Assignee: Jakarta Notifications Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-14 15:16 UTC by Roi Gilboa
Modified: 2005-08-11 15:25 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roi Gilboa 2004-10-14 15:16:31 UTC
Try the following Rexp:
^[a-zA-Z]{0,99}$
(Allows any sequence of alpha characters up to the length of 99)

If you type 'aa bbbb' (white space), it returns false very fast.
If you type 'aaaa bbbb' (again, white space) it returns false after long time
consuming much CPU.
Comment 1 Roi Gilboa 2004-10-14 15:24:02 UTC
I also noticed that if the length of the expression is {1,99} and not {0,99} it
does not occur.
I also believe that longer character sequence before the space increases the
processing time significantly.

The problem reproduces using the sample Applet.
Comment 2 Oleg Sukhodolsky 2005-07-21 11:37:51 UTC
I think this is the same as 9153 (RE.match() hangs when using {n,m})
Comment 3 Vadim Gritsenko 2005-08-11 05:15:05 UTC
Yes, it is.

*** This bug has been marked as a duplicate of 9153 ***