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

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

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: