Personal tools


From MohidWiki

Jump to: navigation, search

Regexp stands for regular expressions. Regular expressions are what made languages like Awk and Perl notorious. Regular expressions are expressions equating a pattern string. To write a regular expression in Perl on must insert it between slashes (/regexp/)For example:


means all the alphabet lowercase letters.


stands for all the digits from 0 to 4 inclusive.


stands for all the sequences of 2, 5 or 7 digits.

The interesting thing is that you can compose regexps into complex patterns. For example the regexp


describes a pattern that will match, for example, the strings B:1.HelloSir or 'A:0.Good. But it will not match a:2.darn because the first letter must be uppercase.

Bounding a whole word:


See also