14.3.  Regular Expressions

[ fromfile: regexp.xml id: regexp ]

Regular expressions are powerful tools for validating input, for extracting data from input, and for searching and replacing. A regular expression, regexp (or regex for short), describes constraints on the way a string is composed, using a formal language for pattern matching.

Regular expressions were first available in tools such as vi, emacs, awk, sed, and the POSIX Standard Library. Perl was the first mainstream programming language to integrate regular expressions so tightly into the language that it caused many people to learn regular expressions for the first time. Many enhancements have been made to the version of regular expressions that Perl recognizes. The enhancements are part of what is called Perl-style extended regular expressions. These extended regular expressions are also available in Java and Python. C++0x and boost also offer C++ regular expression tools.

Qt provides QRegExp, which implements most of the Perl-style extended regular expression language.