Regex (or Regexp ), Regular Expressions - is a special set of rules that forms a search mask/pattern (mainly for use in work with strings: match , split , replace ). Regular expressions are useful in parsing data from text files, websites (html code), xml etc. Regular expressions provide a high-power, flexible, and efficient method for processing text : for example get all email addresses from html-file or delete all phone numbers in a text document. The extensive pattern-matching notation of regular expressions enables you to quickly parse large amounts of text to find specific character patterns ; to validate text to ensure that it matches a predefined pattern (such as an http link); to parse / extract, replace , edit or delete text substrings ; and to add the extracted strings to a collection in order to generate a report. For many applications that deal with strings or that parse large blocks of text, regular expressions are an indispensable tool. Many programming languages provide regular expression capabilities , some built-in, for example Perl, JavaScript, Ruby, AWK, and Tcl, and others via a standard library, for example .NET C# , VB.NET , Java, Python etc.

Each character in a regular expression is either understood to be a metacharacter with its special meaning, or a regular character with its literal meaning. Together, they can be used to identify textual material of a given pattern, or process a number of instances of it that can vary from a precise equality to a very general similarity of the pattern. The pattern sequence itself is an expression that is a statement in a language designed specifically to represent prescribed targets in the most concise and flexible way to direct the automation of text processing of general text files, specific textual forms, or of random input strings. A very simple use of a regular expression would be to locate the same word spelled two different ways in a text editor.

A regex (regular expression) is a pattern that the regular expression engine attempts to match in input text. A pattern consists of one or more character literals, operators, or constructs. For a brief introduction, see .NET Framework Regular Expressions. Each section in this quick reference lists a particular category of characters, operators, and constructs that you can use to define regular expressions: anchors, backreference, character escapes, character classes, grouping constructs, quantifiers, substitutions, options and other.

The System.Text.RegularExpressions namespace contains set of classes that provide access to the .NET Framework regular expression engine. The namespace provides .NET regex functionality that may be used from any platform or language that runs within the Microsoft .NET Framework: C#, VB.NET. Learn more: Wikipedia, Microsoft MSDN, Help and Library.