Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4783892

Pattern.compile("\\") throws internal error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.1_01, 1.4.2
    • core-libs

      When trying to call String.replaceAll("\\", "X") to replace all '\'s with 'X's, the following error has been raised:
       
      Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
       ^
      at java.util.regex.Pattern.error(Pattern.java:1472)
      at java.util.regex.Pattern.compile(Pattern.java:1264)
      at java.util.regex.Pattern.<init>(Pattern.java:1013)
      at java.util.regex.Pattern.compile(Pattern.java:760)
      at java.lang.String.replaceAll(String.java:1706)
      at RA.main(RA.java:5)

      ###@###.### 2002-11-24

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: