| |
RegexStudio Documentation
The premier Regular Expression development environment
for .Net |
The Regex Studio Code Generator
The Code tab highlights the Regex Studio code generator. The purpose is to
generate the code required to use your regular expression in a variety of .Net
languages and environments.
The Code Generator Tab appears as follows:

The Language combo box allows you to choose the language to use. You have the
following options:
C#
VB.NET
ASP.NET
Managed C++ (Visual Studio 2002/2003)
C++/CLI (Visual Studio 2005)
You also have the option of generating exception handling code. ASP.NET does not
use exception handling tags, but the other languages all support it. You might
wish not to handle exceptions, in which case you would turn the checkbox for
this option off.
The Generated Code text field contains the generated code for your specified
language. This has the basic code needed to use this regular expression. If you
click the Copy button, the code will be copied to the clipboard. You can then
switch to your development environment and paste it into your application. You
will then build on top of the code to add the functionality you need.
Note that depending on how your have other options set in Regex Studio, it will
greatly effect the generated code. The code generator uses the following
settings when it generates code:
The actual regular expression: This is converted as needed. For example, in
C++, a string cannot contain the backslash character without adverse effects.
The code generator creates code that can be absorbed by the target language.
The Options tab: These are used and passed into the regular expression through
the RegexOptions structure.
The Test Tab: Match, Replace, Split. Depending on your current setting,
different code is generated.
You will find the code generator a useful tool to generate the initial code to
use your regular expression.