Home Documentation Download Order

Regent Regent

Getting started

For example, you need to add an interesting C++ library to .NET project. C++ library's code is opened in your Microsoft Visual Studio IDE, you find std::string title("Great!"); std::string company("Regex Inference"); std::string welcome("Welcome"); lines and decide to start conversion from strings.

Copy std::string title("Great!"); and paste it in Search for field in Regent. Enter or paste System::String^ title = gcnew System::String("Great!"); in Replace with field. Press Make regular expression. Content for Regular expression and Format string appear sharing common elements and escaping special regular expression language symbols:

Generated regular expression

To make regular expression match all similar fragments select title and click Apply (Regex suggestion of C/C++ identifier is exactly what we need here):

Suggestions for title

Select "Great!" and click Apply (Regex suggestion of Quoted string is exactly what we need again):

Suggestions for Great

That's all you need to know about regular expressions :) Copy resulting std{\:\:}string{ :i}{\(:q\);} and System\1String^\2 = gcnew System::String\3 directly into Visual Studio's Find and Replace dialog using VS button, select Regular expressions usage and Replace them All:

Visual Studio's Find and Replace dialog

Three original lines become System::String^ title = gcnew System::String("Great!"); System::String^ company = gcnew System::String("Regex Inference"); System::String^ welcome = gcnew System::String("Welcome");