replace { (foo) and stuff } with { bar $1 }