Perl/Regex question (hopefully simple)

Phillip Mills pmills-Zd07PnzKK1IAvxtiuMwx3w at public.gmane.org
Tue Jun 29 16:59:20 UTC 2004


On Jun 29, 2004, at 12:33 PM, Madison Kelly wrote:

> Do you know if one method is better or worse than the other or are 
> they just two ways to do the same thing?

I'm not a language lawyer, but 'perldoc perlre' saus, 'The bracketing 
construct "( ... )" creates capture buffers.  To refer to the digit'th 
buffer use \<digit> within the match.  Outside the match use "$" 
instead of "\".'  I've always taken that to mean \<digit> is for the 
left half of the substitution and $<digit> for the right or after, but 
I don't know that for a fact.

Have a look at their discussion of backreferences and see what you 
think.

........................
Phillip Mills
Multi-platform software development
(416) 224-0714

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list