bruce wrote:

> i have the following sample of text...
> 
>     02609 MTWHF   08:30A 10:45A CL    2320         LG     SN  Delgado,
> Leonel Ramon
>     02646 M W     06:00P 09:30P CL    2321         LG     SN  Saiz, Marina
>     17017 M WH    06:00P 09:30P CL    1301         LG     SN  Delgado, Luis
> Miguel
>     14827 MTWHF   08:30A 10:45A CL    G13          LG     SN  Ramirez,
> Natalia Maria
>     13582 MTWHF   08:30A 10:45A FKART 203          LG     SN  Negron-Rivera,
> German
>     03836 M WH    06:00P 09:30P CL    1301         LG     SN  Bruzual,
> Alejandro
> 
> i'm trying to figure out what's the best/easiest to understand regex.. it
> appears that all the information is rather based on a column structure...
> 
> something like this...
> $line =~ /(skip 3 chars)(get 5 chars)(skip 3 chars)...../
> 
> any ideas...

I'd split on whitspace (using split ' ', to avoid leading blanks field)
and limit the number of fields to 9 (thus allowing the last field to
contain blanks.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to