Great Circle Associates Majordomo-Workers
(October 1998)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Regexp wizard
From: Leslie Mikesell <les @ Mcs . Net>
Date: Fri, 2 Oct 1998 20:59:45 -0500 (CDT)
To: tibbs @ hpc . uh . edu (Jason L Tibbitts III)
Cc: rogerk @ QueerNet . ORG, majordomo-workers @ GreatCircle . COM
In-reply-to: <ufaww6j56se.fsf@sina.hpc.uh.edu> from "Jason L Tibbitts III" at Oct 2, 98 10:21:05 am

According to Jason L Tibbitts III:
> 
> To see why this doesn't really map onto regexps well, try translating
> something as simple as "contains abcdef and contains ghijk".  Order matters
> to regexps, so you need the awkward /(abcdef.*ghijk)|(ghijk.*abcdef)/.  The
> complexity increases exponentially from there.

But perl has any number of perfectly fine looping and control operators.
Why try to shoehorn it into a single regexp?  How about just building
whatever size chunk of perl code you need, perhaps knowing that you
have the header lines already in an array, and then eval() the
code for your result?

  Les Mikesell
   les@mcs.com


Follow-Ups:
References:
Indexed By Date Previous: Re: Regexp wizard
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Next: Latest cvs: make install problem
From: "Randall S. Winchester" <rsw@Glue.umd.edu>
Indexed By Thread Previous: Re: Regexp wizard
From: "Roger B.A. Klorese" <rogerk@QueerNet.ORG>
Next: Re: Regexp wizard
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>

Google
 
Search Internet Search www.greatcircle.com