Bug 5243 - Regexp 1.2 RE.match() hangs java.exe
Summary: Regexp 1.2 RE.match() hangs java.exe
Status: CLOSED DUPLICATE of bug 9153
Alias: None
Product: Regexp
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---
Assignee: Jakarta Notifications Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-03 09:57 UTC by Darrell
Modified: 2005-01-11 13:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darrell 2001-12-03 09:57:36 UTC
Matching certain strings against patterns like:
[A-Z]{1,127}@[A-Z]{1,127}

hangs java.exe
eg match using string:
AAAAA

Tested as follows:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.regexp.RE;

public class testIt
{
	public static void main(String[] args) throws Exception
	{
		BufferedReader console = new BufferedReader(
						new InputStreamReader
(System.in));     
		
		System.out.println("RE Pattern?: ");
		String input = console.readLine();
		
		RE r = new RE(input);
		while (true)
		{
			System.out.println("test against?: ");
			String test = console.readLine();
			System.out.println("Pattern is: " + test);
			
			boolean matched = r.match(test);
			System.out.println("MATCHED="+matched);
			
			String wholeExpr = r.getParen(0);
			System.out.println("wholeExpr IS: "+ wholeExpr);
		}
	}
}


RE Pattern:
([A-Z]{1,127}@[A-Z]{1,127})

Hangs java.exe when matched against:
AAAAA

Darrell.
Comment 1 Vadim Gritsenko 2003-04-25 18:16:29 UTC
Bug 9153 has better description. RE not hangs but takes too much time.

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