Regular Expression in C#

Regular Expression:

Regular Expression provides a powerful tool for searching and manipulating a large text. A regular expression may be applied to a text to accomplish tasks such as:

1. To locates substrings and return them.
2. To modify one or more substrings and return them.
3. To identify substrings that begin with or end with a pattern of characters.
4. To find all words that begin with a group of characters and end with some other characters.
5. To find all the occurrences of a substring pattern and many more.

A regular expression is also known as a Pattern String, and it contains two types of characters:

1. Literals – Literals are characters that we wish to search for and match in the text.

2. Metacharacters – Metacharacters are special characters that give commands to the regular expression parser.