What is Regular Expressions in C#.NET?

 Posted by Tripati_tutu on 12/4/2010 | Category: C# Interview questions | Views: 3117 | Points: 40
Answer:

The Regular Expressions are the languages which identifies character patterns. Basically this is used for the following tasks such as:

• To validate the text input such as passwords, numbers etc.
• Parsing the textual data into more structured forms. For example, extracting data from an HTML page to store in database.
• Replacing the pattern of text into a document.

All Regular Expression types are defined in System.Text.RegularExpressions .


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Rak on: 12/31/2010 | Points: 10
Hi Every,
Iam new to this site.I want to say something about Regular Expression Validatior.
Assume that i have 1 Textbox which allow only Numbers(Ex:Entering Age,Mobile Number,etc...).For this we can use this Regular Expression.

(\d{6}[-\s]?\d{12})|(\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4})

This Expression allow numbers 1234556 like
not allow 155eff@grgk90(0)like..

Wish You Happy New Year2011 in advance

Regards&Thanks
Rak...



Login to post response