legend has asked for the wisdom of the Perl Monks concerning the following question:
I want to be able to get (LENGTH: .... ) into one array and so on... I'm trying to use PERL in slurp mode but for some reason I'm having trouble. I solved the problem using "read the file line by line" technique but I want to use the slurp mode to solve it because the input is something like this:LENGTH: Some Content here TEXT: Some Content Here COMMENT: Some Content Here
As you can observe, the data that I want is not limited to one line but rather spans multiple lines so thought using a regex over multiple lines would be better. Do you have any suggestion on how to solve this problem?LENGTH: ...................................................... .................................................................. .................................................................. ................................................................... .................................................................. SUBJECT: ....................................................... COMMENT: ..................................................... ....................................................................
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I need to regex multiple lines
by hipowls (Curate) on Feb 26, 2008 at 07:48 UTC | |
|
Re: I need to regex multiple lines
by jwkrahn (Abbot) on Feb 26, 2008 at 07:39 UTC | |
by svenXY (Deacon) on Feb 26, 2008 at 07:54 UTC | |
|
Re: I need to regex multiple lines
by grizzley (Chaplain) on Feb 26, 2008 at 07:56 UTC | |
|
Re: I need to regex multiple lines
by Erez (Priest) on Feb 26, 2008 at 12:54 UTC | |
|
The requested "slurp-solution"
by rminner (Chaplain) on Feb 26, 2008 at 09:36 UTC | |
|
Re: I need to regex multiple lines
by locked_user sundialsvc4 (Abbot) on Feb 26, 2008 at 16:16 UTC | |
|
Re: I need to regex multiple lines
by legend (Sexton) on Feb 26, 2008 at 19:41 UTC |