Chris E. Rempola wrote:
Chris E. Rempola wrote:
How would you match Parenthesis in Perl?
- STRING -
Received: from 10.143.205.68.abc.def.gh.com (10.205.143.238)
- /STRING -
I want to be able to grab the IP address in (10.205.143.238).
I found out escaping them with '/' works. The following worked for me:
/(\(\d+\.\d+\.\d+\.\d+\))/ #This prints out (10.205.143.238)
How about if I wanted to just grab the IP address itself?
Put the capturing parentheses *inside* the literal parentheses.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/