You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by df...@apache.org on 2003/05/15 17:59:25 UTC
cvs commit: jakarta-oro/src/java/org/apache/oro/text/regex Perl5Matcher.java
dfs 2003/05/15 08:59:25
Modified: . CHANGES
src/java/org/apache/oro/text/regex Perl5Matcher.java
Log:
Fixed bug whereby compiling an expression with
Perl5Compiler.MULTILINE_MASK wasn't always having the proper effect
with respect to the matching of $ even though
Perl5Matcher.setMultiline(true) exhibited the proper behavior. For
example, the following input
" aaa bbb \n ccc ddd \n eee fff "
should produce "bbb ", "ddd ", and "fff " as matches for both the
patterns "\S+\s*$" and "\S+ *$" when compiled with MULTILINE_MASK.
Perl5Matcher was only producing the correct matches for the second
pattern, producing only "fff " as a match for the first pattern
unless setMultiline(true) had been called. This has now been fixed.
Thanks go to "Anders Cederlund" <an...@biglandscape.com>
for reporting this problem.
Revision Changes Path
1.35 +13 -1 jakarta-oro/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/jakarta-oro/CHANGES,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- CHANGES 24 Feb 2003 03:34:09 -0000 1.34
+++ CHANGES 15 May 2003 15:59:24 -0000 1.35
@@ -1,6 +1,18 @@
$Id$
Version 2.0.8-dev-1
+ o Fixed bug whereby compiling an expression with
+ Perl5Compiler.MULTILINE_MASK wasn't always having the proper effect
+ with respect to the matching of $ even though
+ Perl5Matcher.setMultiline(true) exhibited the proper behavior. For
+ example, the following input
+ " aaa bbb \n ccc ddd \n eee fff "
+ should produce "bbb ", "ddd ", and "fff " as matches for both the
+ patterns "\S+\s*$" and "\S+ *$" when compiled with MULTILINE_MASK.
+ Perl5Matcher was only producing the correct matches for the second
+ pattern, producing only "fff " as a match for the first pattern
+ unless setMultiline(true) had been called. This has now been fixed.
+
o Fixed embarrassing bug whereby an expression like (A)(B)((C)(D))+
when matched against input like ABCDE would produce matching groups
of: "A" "B" "" null "D" instead of "A" "B" "CD" "C" "D".
1.24 +3 -2 jakarta-oro/src/java/org/apache/oro/text/regex/Perl5Matcher.java
Index: Perl5Matcher.java
===================================================================
RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/regex/Perl5Matcher.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Perl5Matcher.java 24 Feb 2003 03:34:09 -0000 1.23
+++ Perl5Matcher.java 15 May 2003 15:59:25 -0000 1.24
@@ -1294,7 +1294,8 @@
arg = __repeat(scan, arg);
if(line < arg && OpCode._opType[__program[next]] == OpCode._EOL &&
- (!__multiline || __program[next] == OpCode._SEOL))
+ ((!__multiline && __program[next] != OpCode._MEOL) ||
+ __program[next] == OpCode._SEOL))
line = arg;
while(arg >= line) {
---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org