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:
|
|