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

replaceAll cannot replace backslash

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 1.1-rc-2
    • Component/s: groovy-jdk
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: