Hi There.

Why not use the split function ?

First, chop off the quotes at each end.

s/\"(.*)\"/$1/

Then use split to put each bit that is separated by a space into its own
string.
You can then work with each one individually, which should make life easier
for whoever has to maintain your code.



----- Original Message -----
From: "Gabrio Verratti" <[EMAIL PROTECTED]>
To: "Jakarta Oro (E-mail)" <[EMAIL PROTECTED]>
Sent: Saturday, September 01, 2001 12:09 AM
Subject: a better pattern?


> I'm doing a little testing, so I'm trying to extract data from the
following
> fictitious data items:
>
> "JFK 2001-06-29 TRN 5109-65651-095 ETT 27-938-87"
>  **** **********         ***************        **********
> "SFO 2001-01-15 ARN 2118-76119-202 ETT 20-4-25-4-2"
>  ****  **********        **************         ***********
>
> I wrote the following expression:
> ^([a-z]{3,3})[ \t]+([-0-9]+)[ \t]+(a|t)rn[ \t]+([-0-9]+)[ \t]+ETT[
> \t]+([-0-9]+)
>
> ... and I'm curious to know whether there's an easier alternative that
gets
> me a handle to the sub-expressions underlined with *s?
>
> Regards,
> Gabrio Verratti
> Software Engineer
> [EMAIL PROTECTED]
>
> HNC Software Inc.
> 150 Almaden Blvd.
> San Jose, CA 95113
>

Reply via email to