Regexinator is a Visual Studio add-in that builds regular expression functionality directly into Visual Studio. Using this small tool you can write a regular expression and then run that expression against the document you currently have loaded in Visual Studio. This is a compelling way to create and test regular expressions without leaving Visual Studio. Regexinator is not as powerful as some of the full applications available, Expresso and the Regulator are two of my favorites, but being able to run the expressions inside of the IDE is sometimes worth the trade-offs in functionality.
After downloading and installing Regexinator you will see the following tool window appear in your IDE.
Using this tool window is as simple as entering your regular expression into the top box and then clicking run. For instance if you had a file that contained a number of different email addresses and you needed to write a regular expression that would extract those addresses you would perform the following steps.
1) Load the document into Visual Studio, here is an example of my document:
Here is some text and included in that text is a number of different email addresses including firstname.lastname@example.org as well as email@example.com, this text also includes firstname.lastname@example.org.
2) Enter your regular expression into the RegExinator and then press enter:
3) You will then see each match for your regular expression shown in the tool window:
As you can see this is a quick and easy way to create and test your regular expressions.
Another feature in RegExinator is the ability to search RegExLib, the regular expressions library. The regular expressions library is an online repository for regular expressions that contains thousands of regular expressions. Before writing your own expression, it is a good idea to run a search against the regular expressions library so as to avoid having to write it yourself. (Always a good thing)
To search the regular expressions library simply switch to the RegExLib tab:
You can then simply enter your search criteria in the search box and click the search button. Regexinator will query the regular expressions library and return the results. If you searched for phone number you would see the results shown here:
If you are writing a regular expression for something common like a phone number, zip code, or email address it is a good idea to first check the RegExLib.