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

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.4.1_01, 1.4.2
    • Component/s: 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: