-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 11:30 AM
To: todd shifflett; [EMAIL PROTECTED]
Subject: RE: extracting a string from between parens
I have this situation:
$in = 02 Jul 5.00 (YHZ GA-E)
I want
-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 11:30 AM
To: todd shifflett; [EMAIL PROTECTED]
Subject: RE: extracting a string from between parens
I have this situation:
$in = 02 Jul 5.00 (YHZ GA-E)
I want
I have this situation:
$in = 02 Jul 5.00 (YHZ GA-E)
I want:
$out = YHZGA-E
How do I extract the information between the ()s ?
Other than the parens all other characters are likely to change.
Perhaps
$in =~ /\((.*?)\)/;
$out = $1;
This is a problem if there is no
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote:
$out = $1 if ($in =~ /\((.*?)\)/);
Nope..won't work..I take it back!!
looks ok to me. except it adds extra strokes to previous answer.
what do you think is wrong with it?
-Original Message-
From: bob ackerman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 9:07 AM
To: [EMAIL PROTECTED]
Subject: Re: extracting a string from between parens
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote:
$out = $1
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote:
$out = $1 if ($in =~ /\((.*?)\)/);
Nope..won't work..I take it back!!
looks ok to me. except it adds extra strokes to previous answer.
what do you think is wrong with it?
It will work fine as far as the regex is concerned.
-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 12:26 PM
To: bob ackerman; [EMAIL PROTECTED]
Subject: RE: extracting a string from between parens
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote:
$out
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote:
$out = $1 if ($in =~ /\((.*?)\)/);
Nope..won't work..I take it back!!
looks ok to me. except it adds extra strokes to previous answer.
what do you think is wrong with it?
It will work fine as far as the regex is
On Wednesday, June 26, 2002, at 08:26 , todd shifflett wrote:
I have this situation:
$in = 02 Jul 5.00 (YHZ GA-E)
I want:
$out = YHZGA-E
you have a two stage problem -
a) get the stuff between the ()
b) remove the white space
if ($in =~