title: Indent multiline string with Groovy onliner
body: <p>I'd like to indent a multiline string in Groovy but I can't figure out the right RegEx syntax / or Regex flags to achieve that.</p>
  
  <p>Here's what I tried so far:</p>
  
  <pre><code>def s="""This
  is
  multiline
  """
  println s.replaceAll('/(.*)/',"      \1")
  println s.replaceAll('/^/',"     ")
  println s.replaceAll('(?m)/^/',"      \1")
  println s.replaceAll('(?m)/(.*)/',"      \1")
  </code></pre>
  
  <p>These didn't work as expected for some reason.</p>
  
  <p>The only thing that worked so for is this block:</p>
  
  <pre><code>def indented = ""
  s.eachLine {
    indented = indented + "      " +  it + "\n"
  }
  println indented
  </code></pre>
  
  <p>Is there a shorter / more efficient way to indent all lines of a string in Groovy?</p>