fork(2) download
  1. object Main extends App {
  2. val s = """{"nAMe": "Deloise", "WINS": [["three of a kind", "5"]]}"""
  3. val rx = """(\"[^"]+\" *:)""".r
  4. val replacedStr = rx replaceAllIn (s, m => s"|UPERCASETEST|${m.group(1)}|".toLowerCase())
  5. println(replacedStr)
  6. }
  7.  
Success #stdin #stdout 0.39s 4382720KB
stdin
Standard input is empty
stdout
{|upercasetest|"name":| "Deloise", |upercasetest|"wins":| [["three of a kind", "5♣"]]}