View Problem

Replace all regex matches in a string with a static string

Transform "She sells sea shells" into "She X X shells" by replacing /se\w+/ with "X"
DiskEdit
csharp
using System.Text.RegularExpressions;

class SolutionXX
{
static void Main()
{
string text = "She sells sea shells";
string result = Regex.Replace(text, @"se\w+", "X");
}
}
DiskEdit
clojure
(.replaceAll (re-matcher #"se\w+" "She sells sea shells") "X")
ExpandDiskEdit
cpp C++/CLI .NET 2.0
String^ Replaced = (gcnew Regex("se\\w+"))->Replace("She sells sea shells", "X");
ExpandDiskEdit
cpp C++/CLI .NET 2.0
String^ Replaced = Regex::Replace("She sells sea shells", "se\\w+", "X");

Submit a new solution for csharp, clojure, or cpp
There are 12 other solutions in additional languages (erlang, fantom, fsharp, groovy ...)