in reply to Re: Regex Help
in thread Regex Help

Regarding: "M for 'multiline' matching, ie dont stop at the new line".

Ummm... no. The '/m' modifier only effects the matching of '^' and '$' (when used to match beginning-of-line, end-of-line). It allows these two symbols to match newlines within the string.

The regex m/\(([^)]*)\)/g, will match across new lines. More specifically, the regex m/[^)]/ will match a newline quite happily. if ( "\n" =~ /[^)]/ ) {print "Yes\n"} Yes

Replies are listed 'Best First'.
Re: Re: Re: Regex Help - Correct use of /m
by demerphq (Chancellor) on Sep 07, 2001 at 03:26 UTC
    Very true.
    I apologise. For some reason I got confused. For me the mantra is 'Ignore, multi-line, as single,' and I forgot the ^$ part.
    And yes I did want to match a newline with my class. What if one were embedded in the () (forget the origin of the text for a second)
    Ill fix my post.

    Yves
    --
    You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)