text: I have an XML file that contains a "Description" property. I would like to replace the contents of that property with a different description. I am using a SED command within a Groovy script
  <VisualElements Description="foo" Title="title"/>
  def sedCommand = 'sed -i \'s/Description="([^"]*)"/Description="bar"/g\' package.appxmanifest' as String
  You are using sed with a BRE regex (i.e. no
  -E or
  -r options), so your
  ( and
  ) are parsed as literal parentheses, not a grouping construct. Anyway, you are not using backreferences and replacing the whole match, there is no point keeping the parentheses at all:
  def sedCommand = 'sed -i \'s/Description="[^"]*"/Description="bar"/g\' package.appxmanifest' as String ^^^^^
  will work well.
  If you need to use variables, see How do I use variables in a sed command?
  The sed command will look as
  #!/bin/bash' | \ sed 's/Description="[^"]*"/Description="'$foo'"/g'