DocTaur - intranet directory of reference manuals
Yo-store
books for webmasters

reference manuals search engine

Perl Tutorial Book

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.5 Grouping with ()s

Sometimes, within regular expressions, we want to group things together. Doing this allows building of larger regular expressions based on smaller components. The ()'s are used for grouping.

For example, if we want to match any string that contains abc or def, zero or more times, surrounded by a xx on either side, we could write the regular expression xx(abc|def)*xx. This applies the * character to everything that is in the parentheses. Thus we can match any strings such as xxabcxx, xxabcdefxx, etc.


This document was generated on July, 31 2004 using texi2html 1.70.