-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.1
-
x86
-
windows_98
Name: rmT116609 Date: 07/09/2002
FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows Millennium [Version 4.90.3000], Solaris2.8.
A DESCRIPTION OF THE PROBLEM :
java.util.regex.Pattern:
in Multiline-Mode the Boundary matcher "$" matches almost everywhere in the input.
REGRESSION. Last worked in version 1.4
---------- BEGIN SOURCE ----------
import java.util.regex.*;
public class PatternTest {
public static void main(String[] args) {
Pattern pattern = Pattern.compile("$", Pattern.MULTILINE);
System.out.println(pattern.matcher("Hello World").replaceAll("x"));
}
}
---------- END SOURCE ----------
EXPECTED VERSUS ACTUAL BEHAVIOR :
Actual Result: xHxexlxlxox xWxoxrldx
Expected: Hello World
or
Hello Worldx
REPRODUCIBILITY :
This bug can be reproduced always.
Release Regression From : 1.4
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 158747)
======================================================================
- duplicates
-
JDK-4711773 REGRESSION: Regex: replacing '$' i.e. EOL fails
-
- Closed
-