View Problem

Replace the first regex match in a string with a static string

Transform "Red Green Blue" into "R*d Green Blue" by replacing /e/ with "*"
DiskEdit
python
print re.sub(r'e', '*', 'Red Green Blue', 1)
ExpandDiskEdit
fsharp
let replaced = ((new Regex("e")).Replace("Red Green Blue", "*", 1))
printfn "%s" replaced
ExpandDiskEdit
fantom
replaced := Regex<|e|>.split("Red Green Blue",2).join("*")
DiskEdit
groovy
replaced = "Red Green Blue".replaceFirst("e", "*")

Submit a new solution for python, fsharp, fantom, groovy ...
There are 11 other solutions in additional languages (clojure, cpp, erlang, go ...)