--- "Gross, Stephan" <[EMAIL PROTECTED]> wrote:
> I wasn't clear last time. I 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)
> >Example:
> >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?
>
> The problem is the final parenthesis. If I use (.*) or (\w*) then it
> swallows the final parenthesis. I want to discard it if it is
> present. Also, the XYZ term may include spaces.
"swallows"? As in, it gets included in the pattern?
of (\w*) ????
Could you elaborate, and/or post an example?
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/