String::replaceAll method in groovy script works not as described in man.

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      ...
      def testString = "Multi line"
      def testStringReplaced = ( testString.replaceAll(~/(line)/,

      { it[0] + it[0] }

      ) )
      echo testStringReplaced
      ...

      This block produces output: lineline
      I expect it to produce: Multi lineline

            Assignee:
            Unassigned
            Reporter:
            Vladimir Fomenko
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: