.Net Regex builder

.Net Regex builder:

Build and test regular expressions using .Net's powerful Regular expression engine.

Note: This is not an emulator (like some regex testers on the web). It directly calls the server's .Net Regular expression engine. What you see is what you get.

The page supports testing







The results are shown in easy to understand tables showing all matches, all groups and captures.

Enter regular expression in code string format (like you would in code).

Supports setting all .Net Regex options.

Syntax errors will be reported as you type. When errors have been fixed a Regex construtor will be shown, ready to copy/paste.

The syntax you use depends on the string format, you have chosen (the tabs).

You can choose between literal verbatim string format and normal literal string format. Switching between them will convert the regular expression to that format.

Regex string format:

  1. Literal verbatim string (@"")

    : Here you don't need to double escape control characters, example '\n' matches a newline.
    Doublequotes must be doubled, example ''""'' matches one doublequote.
  2. Literal code string ("")

    : Here you need to double escape all control characters, example '\\n' matches a newline.
    Doublequotes must be escaped, example '\"' matches one doublequote.

The 'Regex constructor' will show the Regex constructor based on your Regex and options, ready to copy and paste into your code.
Switching to the other string type (by clicking the tabs) will also change the constructor to that format.