Brain,
Thanks for the direction! I really need to learn more about regex. I will
certainly read those!
Kristofer
Original Message Follows
From: Brian <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: Extract numbers from in between parenthese
Kristofer,
you might want to check out the man page's perlrequick and perlre- I found
them pretty useful when I was first learning regex (the man page perlretut
isn't bad either).
Either way, try this;
my $string = '(608)-555-1234';
$string =~ /\((\d+)\)-(\d+)-(\d+)/;
this results in $1=608, $2
Kristofer --
...and then Kristofer Hoch said...
%
% David(s),
% Thank you for your help. It works perfectly now. I am adding in both of
% y'alls names into my class file for your help.
Happy to help!
%
%
% (803 is South Carolina, which should explain the accent on the yall)
I know. Less
t;[EMAIL PROTECTED]>
To: perl beginners cgi <[EMAIL PROTECTED]>
CC: Kristofer Hoch <[EMAIL PROTECTED]>
Subject: Re: Extract numbers from in between parentheses with regex
Date: Wed, 26 Jun 2002 14:03:52 -0500
Kristofer --
and then Kristofer Hoch said...
%
% David,
% Thank you
Kristofer --
...and then Kristofer Hoch said...
%
% David,
% Thank you very much for your help. Don't know Utah, I have a lot of
% friends from there. The expression you provided is almost what I am after..
% Here is my string.
%
% my $String = "Characters(803), Value(3)";
%
% What I am try
uot;(803)". Is there a way
to get 803 without the enclosing parens?
Thank you
Kristofer
Original Message Follows
From: <[EMAIL PROTECTED]>
To: "Kristofer Hoch" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: Re: Extract numbers from in betwe
stofer Hoch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 26, 2002 10:21 AM
Subject: Extract numbers from in between parentheses with regex
Hi all,
Please forgive the simple nature of this question. I have never really
used regular expression extensivly.
Hi all,
Please forgive the simple nature of this question. I have never really
used regular expression extensivly.
Here goes. I am trying to extract a number from in between two
parenthesis. I want the first value I find (from right to left) in a string.
These numbers could be phone number