[boulder.pm] FW: text extract

Jay Kominek Jay.Kominek at colorado.edu
Wed Jul 25 18:23:36 CDT 2001


On Wed, 25 Jul 2001, Justin Crawford wrote:

> Thanks Chip.  My first example was misleading.  It's more like:
>
> -
> haystack
> haystack
> haystack
> ;
>
> -
> haystack
> haystack
> NEEDLE!
> haystack
> ;

undef $/;
$data = <>;
$data =~ /^-.+?NEEDLE!.+?;$/sm;

Hopefully you can modify that to narrow down what matched, or where it was
matched, as needed.

The other possibility appears as though it might be to split the entire
file on \n\n and then grep each element of the returned array for NEEDLE!

- Jay Kominek <jay.kominek at colorado.edu>
  If you can't do it in Perl,
  it probably isn't worth doing.




More information about the Boulder-pm mailing list