Re: [perl #34287] perlfaq6: /m matching beyond the first newline
by Yitzchak Scott-Thoennes other posts by this author
Feb 28 2005 5:10PM messages near this date
[perl #34287] perlfaq6: /m matching beyond the first newline
|
Re: [perl #34287] perlfaq6: /m matching beyond the first newline
On Mon, Feb 28, 2005 at 08:12:20PM -0000, Dan Jacobson wrote:
> perlfaq6.pod: "/m" allows caret and dollar to match next to a newline,
> not just at the end of the string.
>
> Add: "You'll still need /mg if you want to match beyond the first
> newline."!
But that's not true. Consider:
$ perl -we'"abc\ndef\nghi\n" =~ /^ghi/m; print $&'
ghi
I think /m and its effect on ^ and $ are well enough described in
perlre (which the preceeding sentence directs you to). Can you
describe the code you were using that you found confusing? That would
help in figuring out what improvements in the doc might have helped
you.
Thread:
Dan Jacobson
Yitzchak Scott-Thoennes
Ronald J Kimball
|