> > >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 match. $1 will have whatever it's >previous value was. Just use match operator in list context: > ($out) = $in =~ /\((.*?)\)/; >Now $out will be undef if there is no match. >or >$out = $1 if ($in =~ /\((.*?)\)/); Nope..won't work..I take it back!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]