problem: regexp ignores some capturing parantheses.

From: Klaus Robert Suetterlin From: (krs_at_robert2.mpe-garching.mpg.de)
Date: 07/29/04


Date: Thu, 29 Jul 2004 16:46:40 +0000 (UTC)

Is there a rule which capturing parantheses are ignored?

For example I found the following:

% info patchlevel
8.4.6
% regexp -about "(?:( ))"
1 REG_UNONPOSIX
% regexp -about "(?!( ))"
0 {REG_ULOOKAHEAD REG_UNONPOSIX}
% regexp -about "(?!(( )))"
1 {REG_ULOOKAHEAD REG_UNONPOSIX}
% regexp -about "(?!() ())"
0 {REG_ULOOKAHEAD REG_UNONPOSIX REG_UUNSPEC}
% regexp -about "(?!(() ()))"
2 {REG_ULOOKAHEAD REG_UNONPOSIX REG_UUNSPEC}

Why does the lookahead constraint strip one (and only one) level
of parantheses on its contaned re?

Greetings, Robert S.