Sunday, March 18, 2007

What is RegEx (Regular Expression) ?


Regular expressions are a language that can be used to explicitly describe patterns within strings of text. In addition to simply describing such patterns, regular expression engines can typically be used to iterate through matches, to parse strings into substrings using patterns as delimiters, or to replace or reformat text in an intelligent fashion. They provide a powerful and usually very succinct way to solve many common tasks related to text manipulation.

Quantifiers

1. *, which describes "0 or more occurrences"
2. +, which describes "1 or more occurrences"
3. ?, which descirbes "0 or 1 occurrence

Explicit quantifiers use curly braces {} and number values for upper and lower occurrence limits within the braces.
eg:
ab{2}c abbc, aaabbccc

for more details please visit the following url
http://msdn2.microsoft.com/en-us/library/ms972966.aspx

Need more examples visit http://www.regular-expressions.info/

No comments: