Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: Why multiline regex doesn't work?by nbd (Novice) |
on Jun 09, 2015 at 00:19 UTC ( [id://1129573]=note: print w/replies, xml ) | Need Help?? |
I was guided by this part of perldoc:
- m modifier (//m): Treat string as a set of multiple lines. '.' matches any character except "\n" . ^ and $ are able to match at the start or end of any line within the string. - both s and m modifiers (//sm): Treat string as a single long line, but detect multiple lines. '.' matches any character, even "\n" . ^ and $ , however, are able to match at the start or end of any line within the string. Does the correction in the code you made mean that Perl processes the multiline string line by line and not as a single string?UPDATE: I see that Perl process the string as a whole. The code from the first sight just looked as an awk line by line pattern matching. Thanks.
In Section
Seekers of Perl Wisdom
|
|