title: scala regex group matching and replace
body: <pre><code>val REGEX_OPEN_CURLY_BRACE = """\{""".r
  val REGEX_CLOSED_CURLY_BRACE = """\}""".r
  val REGEX_INLINE_DOUBLE_QUOTES = """\\\"""".r
  val REGEX_NEW_LINE = """\\\n""".r
  
  // Replacing { with '{' and } with '}'
  str = REGEX_OPEN_CURLY_BRACE.replaceAllIn(str, """'{'""")
  str = REGEX_CLOSED_CURLY_BRACE.replaceAllIn(str, """'}'""")
  // Escape \" with '\"' and \n with '\n'
  str = REGEX_INLINE_DOUBLE_QUOTES.replaceAllIn(str, """'\"'""")
  str = REGEX_NEW_LINE.replaceAllIn(str, """'\n'""")
  </code></pre>
  
  <p>Is there a simpler way to group and replace all of these <code>{,},\",\n</code>?</p>