in reply to Warnings Are Good! Plus A Question about $1
In other words, use "backslash-digit" to refer to a paren'ed chunk while you're still in the left side of the expression, use "dollar-digit" to place a chunk in the replacement pattern.The bracketing construct "( ... )" creates capture buffers. To refer to the digit'th buffer use \<digit> within the match. Outside the match use "$" instead of "\". (The \<digit> notation works in certain circum stances outside the match. See the warning below about \1 vs $1 for details.) Referring back to another part of the match is called a backreference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Warnings Are Good! Plus A Question about $1
by petdance (Parson) on Apr 07, 2002 at 15:38 UTC |