Michael Alipio am Sonntag, 21. Januar 2007 13:07: > D. Bolliger <[EMAIL PROTECTED]> > > Because everything matched - that is: vd=\w+(,) - is replaced with the > > semicolon. > > > > You seem to misunderstand the meaning of the capturing parenthesis '()' > > on the left part of the substitution: They do not indicate the part of > > the string that is to be replaced; replaced is what the left side of the > > substitution matches. > > I see... so in substitutions, all patterns in the left side are those that > have to be substituted, regardless of which is enclosed in parenthesis.
Yes (and the whole left side constitutes *the* search pattern). > However in a plain regexp look ups, only those inside the parenthesis are > being matched... [snipped] No, only those inside the parenthesis are being *catched* into the $1..$n variables. For the catching taking place, the *whole* regex must match, and what's catched is/are part(s) of what matched. Dani -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/