Microsoft’s .NET provides a solid implementation of regular expressions. You can use it in your .NET application simply by importing the namespace System.Text.RegularExpressions. While .NET’s regex syntax hasn’t changed since .NET 2.0, which was released way back in 2005, other parts of the .NET framework that the regex engine depends on have changed. In particular, newer versions of .NET have been updated for newer versions of Unicode, which affects the characters matched by character classes and Unicode properties in your regular expressions, and even how case insensitivity is applied. RegexBuddy is aware of all these subtle changes. Simply tell RegexBuddy which version of .NET and which .NET language you’re using to properly test and analyze your regular expressions.
First, use RegexBuddy to define a regex or retrieve a regexp saved in a RegexBuddy library. Rely on RegexBuddy’s clear regex analysis, which is constantly updated as you build the pattern, rather than dealing with the cryptic regex syntax on your own. Detailed help on that syntax is always only a click away.
If you copied a regex written for a different regex engine then simply paste it into RegexBuddy, select the original language, and convert the regex to one of the .NET flavors.
If you created a new regular expression, test and debug it in RegexBuddy before using it in your .NET application. Test each regex in RegexBuddy’s safe sandbox without risking precious data. Quickly apply the regex to a wide variety of input and sample data, without having to produce that input through your application.
Finally, let RegexBuddy generate a source code snippet that you can copy and paste directly into Visual Studio or whichever IDE or code editor you use. Just choose what you want to use the regex for, and a fully functional code snippet is ready. You can change the names of variables and parameters to suit your naming style or the current situation, which RegexBuddy automatically remembers. RegexBuddy can generate code snippets for C#, Visual Basic, PowerShell, F#, IronPython and Python.NET.
Don’t bother trying to remember which classes to use or which methods to call. And don’t worry about properly escaping backslashes and quotes. Just tell RegexBuddy what you want to do, and you will get the proper code straight away. Anything can be done: testing a string for a match, extracting search matches, validating input, search-and-replace, splitting a string, etc. Choose whether to create a reusable regex object for best runtime performance, or whether to use a one-line convenience function for maximum source code readability. RegexBuddy wraps its code with the proper exception handlers, so you will never get unhandled exceptions out of the blue.
RegexBuddy also has specific support for the Visual Studio 2012 (and later) IDE. Since 2012 the IDE also uses the .NET regex flavor. But it does not support any regex options other than case insensitivity, which is on rather than off by default. RegexBuddy takes care even of such minor details. Create and test your regex in RegexBuddy with the same limitations as the Visual Studio IDE.