Date: Fri, 31 Mar 2006 13:01:16 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ken Borowiak <evilpettingzoo97@AOL.COM>
Subject: Re: How to Under the follow Perl
Content-Type: text/plain; charset="us-ascii"; format=flowed
In example 1 where you find \( in the PAREN regex, where the \
character is masking the open parens character.
In example 3 you find \((, where \( is the same as above and the second
( starts the beginning of a capture buffer used later in the example.
Does this answer your first question?
From: James Pan <jamespannyc@YAHOO.COM>
Sent: Fri, 31 Mar 2006 12:06:28 -0500
Subject: How to Under the follow Perl
I am learning Perl through SAS website.
Under Pattern Matching Using SAS Regular Expressions (RX) and Perl
Example 3: Extracting a Substring from a String
paren = "\(([2-9]\d\d)\) ?[2-9]\d\d-\d\d\d\d";
dash = "([2-9]\d\d)-[2-9]\d\d-\d\d\d\d";
1. Why paren and dash is different from Example 1? Why need \(( rather
just |( ?
2. Use the PRXPAREN function to determine which submatch to use.
returns the last submatch that was matched. If an area code matches the
(XXX), PRXPAREN returns the value 2. If an area code matches the form
PRXPAREN returns the value 4. How to get 2 and 4? Could anyone explain
detail? I can not get there.