www.delorie.com/gnu/docs/regex/regex_20.html   search  
 
Buy the book!


Regex

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

3.7 Grouping Operators (( ... ) or \( ... \))

A group, also known as a subexpression, consists of an open-group operator, any number of other operators, and a close-group operator. Regex treats this sequence as a unit, just as mathematics and programming languages treat a parenthesized expression as a unit.

Therefore, using groups, you can:

If the syntax bit RE_NO_BK_PARENS is set, then `(' represents the open-group operator and `)' represents the close-group operator; otherwise, `\(' and `\)' do.

If the syntax bit RE_UNMATCHED_RIGHT_PAREN_ORD is set and a close-group operator has no matching open-group operator, then Regex considers it to match `)'.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003