in reply to Re: Why multiline regex doesn't work?
in thread Why multiline regex doesn't work?
- 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why multiline regex doesn't work?
by AnomalousMonk (Archbishop) on Jun 09, 2015 at 01:14 UTC | |
|
Re^3: Why multiline regex doesn't work?
by jeffa (Bishop) on Jun 09, 2015 at 00:40 UTC | |
|
Re^3: Why multiline regex doesn't work? ( ^$\n? anchors are "string location assertion")
by Anonymous Monk on Jun 09, 2015 at 01:11 UTC |