in reply to extract text from multi-line context
Well, your regex doesn't mention newlines :/)
your data has newlines
all that dumpoff stuff has newlines in between
its like whitespace :)
add that ( [\r\n ]+ ) to your pattern
And quotemeta
use Path::Tiny qw/ path /; my $raw = path( $file )->slurp_raw; my $re = qr{ \Q$dumpoff $end\E [\r\n ]+ (\#[\d]+) [\r\n ]+ \Q$dumpon $end\E [\r\n ]+ (.*?) \#[\d]+ }sx; while( $raw =~ m/$re/g ){ my( $id, $tidy ) = ( $1, $2 ); ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: extract text from multi-line context
by herman4016 (Acolyte) on Aug 15, 2014 at 10:12 UTC | |
by Anonymous Monk on Aug 15, 2014 at 10:28 UTC | |
by herman4016 (Acolyte) on Aug 16, 2014 at 09:08 UTC | |
by Anonymous Monk on Aug 16, 2014 at 09:51 UTC |