Bug 22943 - regex: quantifier (?*+{}) without preceding token
Summary: regex: quantifier (?*+{}) without preceding token
Status: RESOLVED DUPLICATE of bug 22884
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 19:11 UTC by from-classpath
Modified: 2006-01-16 22:34 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-15 12:56:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description from-classpath 2005-05-11 19:11:59 UTC
Exception in thread "main" java.lang.ExceptionInInitializerError
        <<No stacktrace available>>
Caused by: java.util.regex.PatternSyntaxException: At position 1 in regular expression pattern:
quantifier (?*+{}) without preceding token
        (?i:((http|https|ftp|irc)://[^s]+))
         ^
        at java.util.regex.Pattern.<init>(Pattern.java:107)
        at java.util.regex.Pattern.compile(Pattern.java:144)
        at java.util.regex.Pattern.compile(Pattern.java:126)
        at org.jibble.logbot.LogBot.<clinit>(LogBot.java:11)

This one can easily be reproduced with pirc logbot (http://www.jibble.org/files/LogBot-0.1.0.zip).
Comment 1 Mark Wielaard 2005-09-15 12:56:45 UTC
Wayne Beaton sent me a similar report with a small test case (found by trying
EMF features in eclipse and creating an interface describing an object and
attempt to generate an EMF model based on that interface).

package org.eclipse.tests.java;

import java.util.regex.Pattern;

public class Main {
	public static void main(String[] args) {
	
Pattern.compile("@[\\f\\n\\r\\t*]*model[\\f\\n\\r\\t*]*((\\w*\\s*=\\s*(['\"])(?>\\.|.)*?\\3[>\\f\\n\\r\\t*]*)*)");
 	}
 }
 
The resulting exception is:
 
Exception in thread "main" java.util.regex.PatternSyntaxException: At
position 17 in regular expression pattern:
quantifier (?*+{}) without preceding token
 	@[ \f\n\r\t*]*model[ \f\n\r\t*]*((\w*\s*=\s*(['"])(?>\.|.)*?\3[ \f\n\r> \t*]*)*)
 	                 ^
    at java.util.regex.Pattern.Pattern(java.lang.String, int)
 (/usr/lib64/libgcj.so.6.0.0)
    at java.util.regex.Pattern.compile(java.lang.String, int)
 (/usr/lib64/libgcj.so.6.0.0)
    at org.eclipse.tests.java.Main.main(java.lang.String[]) (Unknown Source)
    at .main (/usr/lib64/libgij.so.6.0.0)
    at .__libc_start_main (/lib64/libc-2.3.5.so)

Confirmed with a recent GNU Classpath and jamvm:

java.util.regex.PatternSyntaxException: At position 17 in regular expression
pattern:
quantifier (?*+{}) without preceding token
        @[ \f\n\r\t*]*model[ \f\n\r\t*]*((\w*\s*=\s*(['"])(?>\.|.)*?\3[
\f\n\r\t*]*)*)
                         ^
   at java.util.regex.Pattern.<init> (Pattern.java:106)
   at java.util.regex.Pattern.compile (Pattern.java:143)
   at java.util.regex.Pattern.compile (Pattern.java:125)
   at Main.main (Main.java:5)
Comment 2 Ito Kazumitsu 2006-01-16 22:19:21 UTC
The bug reported in the original article is the same as the Bug #22884,
and it has been fixed.

The bug of comment #1 is another one. I will open another case.



*** This bug has been marked as a duplicate of 22884 ***
Comment 3 Ito Kazumitsu 2006-01-16 22:34:43 UTC
As for the bug of comment #1, see Bug #25812.