in reply to Re: S And M -- modifiers, that is...
in thread S And M -- modifiers, that is...

I think that's a useful mnemonic. And it may help people to remember that those are the only things the /m and /s modifiers affect. The /s modifier only affects whether "." will match a newline. The /m modifier only affects whether ^ and $ can match at embedded newlines in the middle of a string. Other than that, everything else remains unaffected... in particular, "\n" and "\s" will always match newline characters, regardless of what modifiers are set.

-- Mike

--
just,my${.02}

  • Comment on Re: Re: S And M -- modifiers, that is...

Replies are listed 'Best First'.
Re^3: S And M -- modifiers, that is...
by Anonymous Monk on Jun 22, 2005 at 18:30 UTC
    don't understand. I actually printed out the size of @matches using "$#matches" and it all came out as 0. So how does the last non-greedy match work? thanks for explaining first.