Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am having some problems with matching across multiple lines, even using the /s modifier. I have a piece of document I need to pick up: it starts with " Start" on one line and finishes with " End" on another.
I have tried using the following bit of code:
But this doesn't seem to print anything. What am I doing wrong?while(<>){ if (m/ Start(.*?) End/sg) {print $1;} }
Cheers,
S D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching across multiple lines
by jasonk (Parson) on Jul 19, 2005 at 14:08 UTC | |
|
Re: Matching across multiple lines
by davorg (Chancellor) on Jul 19, 2005 at 14:11 UTC | |
|
Re: Matching across multiple lines
by Transient (Hermit) on Jul 19, 2005 at 14:09 UTC | |
|
Re: Matching across multiple lines
by kwaping (Priest) on Jul 19, 2005 at 14:55 UTC | |
by Anonymous Monk on Jul 20, 2005 at 08:45 UTC | |
|
Re: Matching across multiple lines
by Anonymous Monk on Jul 19, 2005 at 14:08 UTC | |
|
Re: Matching across multiple lines
by graff (Chancellor) on Jul 20, 2005 at 03:42 UTC | |
|
Re: Matching across multiple lines
by anniyan (Monk) on Jul 19, 2005 at 14:08 UTC | |
by davorg (Chancellor) on Jul 19, 2005 at 14:13 UTC |