Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2225

replaceAll cannot replace backslash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • 1.1-rc-2
    • groovy-jdk
    • None
    • redhat enterprise workstation 4

    Description

      when calling the replaceAll function on java.lang.String with a backslash :

      println 'xxxx'.replaceAll('x',

      {'\\'}

      )

      I get the following exception:

      Caught: java.lang.StringIndexOutOfBoundsException: String index out of range: 1

      any other character does not cause the same exception

      Attachments

        Activity

          People

            paulk Paul King
            eduardp Eduard Penzhorn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: