Bug 22884

Summary: java.util.regex.Pattern doesn't understand (?s)
Product: classpath Reporter: from-classpath
Component: classpathAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: andrew, bug-classpath
Priority: P3    
Version: unspecified   
Target Milestone: 0.90   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description from-classpath 2005-02-23 14:26:24 UTC
hi,

 I have a regular expression that uses one of the inline switches documented in the Sun javadoc implementation of java.util.regex.Pattern and when running under classpath I get the following error:

At position 1 in regular expression pattern:
quantifier (?*+{}) without preceding token
        (?s)<!--(.)+?-->

Comment 1 from-classpath 2005-02-23 14:28:26 UTC
(?s) is the DOTALL switch, which makes the wildcard . character match any character including newlines

rather than going through the class API, you can embedd the string (?s) in your pattern and DOTALL mode will be activated
Comment 2 cvs-commit@developer.classpath.org 2006-01-16 15:40:17 UTC
Subject: Bug 22884

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch: 	
Changes by:	Ito Kazumitsu <itokaz@savannah.gnu.org>	06/01/16 13:38:25

Modified files:
	.              : ChangeLog 
	gnu/regexp     : RE.java RESyntax.java 

Log message:
	2006-01-16  Ito Kazumitsu  <kaz@maczuka.gcd.org>
	
	Fixes bug #22884
	* gnu/regexp/RE.java(initialize): Parse embedded flags.
	* gnu/regexp/RESyntax.java(RE_EMBEDDED_FLAGS): New syntax bit.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6082&tr2=1.6083&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/regexp/RE.java.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/regexp/RESyntax.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text



Comment 3 Ito Kazumitsu 2006-01-16 22:04:26 UTC
Fixed.  
Comment 4 Ito Kazumitsu 2006-01-16 22:19:21 UTC
*** Bug 22943 has been marked as a duplicate of this bug. ***
Comment 5 Ito Kazumitsu 2006-02-02 17:02:15 UTC
*** Bug 26075 has been marked as a duplicate of this bug. ***