Regular expressions are used for searching and manipulating a large text. A regular expression check the following condition such as
· To identify substrings that begins with or ends with a pattern of characters.
· To find all words that begins with a group of character and end with some others characters.
· Check the occurrence of a string pattern.
· To modify one or more substrings and return them
It is also know as pattern string. It is the part of strings and it containing two types of characters.
· and metacharacters
“\bt” which means any word beginnings with t.
Where \b is metacharacter and t is the literals.
We used the namespace System.Text.RegularExpression for regular expression. Such namespace contain number of classes that can be used for searching and matching and modifying a text document. The important classes are
How uses these classes in our program
public static void Main()
str = "india,srilanka,nepal,berma";
Regex reg = new Regex("|,");
foreach (string s in reg.Split(str))