[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re(3): [MacPerl] Regular Expression Definition



At 02.43 +0100 98-11-08, Mark Yannuzzi wrote:
>I did not understand the use of the $1, $2.. variables...

After a match, these variables contain whatever matched between parentheses
in your regex. If your regex is:

/blah (yada yada) blah/

the $1 variable will contain the string "yada yada" after a successful match.

If your regex contains more than one pair of parentheses:

/blah (yada) yada (blah)/

The $1 variable will contain "yada" and $2 will contain "blah".


___Carl_Johan_Berglund_________________________
   Adverb Information
   carl.johan.berglund@adverb.se
   http://www.adverb.se/



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch