cpp C++/CLI .NET 2.0String^ Replaced = Regex::Replace("The {Quick} Brown {Fox}", "{(\\w+)}", gcnew MatchEvaluator(&RegRep::RepGroup));
using namespace System;
using namespace System::Text::RegularExpressions;
ref class RegRep
{
public: static String^ RepGroup(Match^ m)
{
array<System::Char>^ sa = m->Groups[1]->Captures[0]->ToString()->ToCharArray();
Array::Reverse(sa); return gcnew String(sa);
}
};
int main()
{
String^ Replaced = Regex::Replace("The {Quick} Brown {Fox}", "{(\\w+)}", gcnew MatchEvaluator(&RegRep::RepGroup));
Console::WriteLine(Replaced);
}