Not having Perl up and running, would this work with the parenthesis??

$temp = ~ m/PT[\(]*(\w+)[\)]*/;
$value = $1;

I'm sure there is a one-line answer, but I'm too new to know.

At 05:13 PM 5/10/2001 -0400, Gross, Stephan wrote:
>I want to match the following:
>1) the letters "PT"
>2) a space or nothing
>3) a word that may or may not be in parentheses or even not exist
>and return item #3 (which may be null)
>PT (XYZ) or PT XYZ or PTXYZ or PT
>should return "XYZ" except the last case, which should return "".
>I can do everything except the parentheses case.  Any ideas?
>Stephan Gross       Loral Skynet     908-470-2388     [EMAIL PROTECTED]

Reply via email to