in reply to Re: (jeffa) Re: Searching for variable then blank lines
in thread Searching for variable then blank lines
Try it out: ;)
I'm sticking to my answer (well, if i had COPIED IT CORRECTLY!!! bad jeffa!) , remember that the 's' modifier allows . to match that newline. Your suggestion would be pretty much the same (and i will admit possibly a bit safer) except you NEED 'm' and ^ in case ARCSERVE.NLM appears in the middle or end of a line.use strict; my $arc = 'ARCSERVE.NLM'; my $slurped = do {local $/; <DATA>}; #my ($temp) = $slurped =~ /^($arc.*)\n\n/sm; my ($temp) = $slurped =~ /($arc.*?\n)\n\n/s; print $temp; __DATA__ not this one or this one asdffARCSERVE.NLM or even this one ---------------- ARCSERVE.NLM sign here and here and here and here and here ---------------- but not here blah blah blah blah blah blah
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Exiting when parsing files
by rscott212 (Sexton) on Mar 14, 2002 at 19:38 UTC | |
by jeffa (Bishop) on Mar 15, 2002 at 15:05 UTC |