NET Regular Expression API Free Tools Advanced Topics Conclusion Resources About the Author Support for regular expressions in the Microsoft®.NET Framework is first-class, and even just within Microsoft® ASP.
For example, x would match exactly five x characters (xxxxx).
When only one number is specified, it is used as the upper bound unless it is followed by a comma, such as x, which would match any number of x characters greater than 4.
Eventually, Ken Thompson built support for regular expressions into qed and grep, both very popular text utilities.
Jeffrey Friedl goes into more depth in his book, Mastering Regular Expressions (2 edition), which is strongly recommended for those wishing to learn more about the theory and history behind regular expressions.
(14 printed pages) Download the source code for this article.
Whether you need to validate user input, search for patterns within strings, or reformat text in powerful ways, regular expressions can help.
You've already learned about several metacharacters, such as the *, ? Several other characters have special meaning within the language of regular expressions. This is often the case for validation scenarios, such as ensuring the user entered something that is the proper format for a postal code or telephone number.
The ^ metacharacter is used to designate the beginning of a string (or line), and the $ metacharacter is used to designate the end of a string (or line).
In the last five decades, regular expressions have slowly made their way from mathematic obscurity to a staple feature of many tools and software packages.