bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/22802] java.util.regex.Pattern doesn't handle parens in c


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22802] java.util.regex.Pattern doesn't handle parens in character sets consistently
Date: 16 Oct 2005 01:27:16 -0000

Pattern.compile("[(]") works and matches a single open paren, but
Pattern.compile("([(])") doesn't, nor does Pattern.compile("(?:[(])").

I'm not sure whether parens in character sets need to be escaped, but either
way the current behavior is inconsistent.

A workaround is to extract the paren from the character set and use something
like (?:[abc]|() instead.

 % gcj --version
gcj (GCC) 4.0.0 20041125 (experimental)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22802





reply via email to

[Prev in Thread] Current Thread [Next in Thread]