fork(3) download
  1. object Main extends App {
  2. val pattern = """(?<=\$\{)[^\s}]+(?=})""".r
  3. val s = "This is a string with ${var1} and ${var2} and {var3}"
  4. val vals = pattern.findAllIn(s)
  5.  
  6. println(vals.toList)
  7. }
Success #stdin #stdout 0.43s 322432KB
stdin
Standard input is empty
stdout
List(var1, var2)