in reply to Re: Two-dimensional match/regex?
in thread Two-dimensional match/regex?

my $target = q{ MM oo < -/ /^\ : C : 8===8 |^| ||| -~-~ }; print "Match!\n" if ($target =~ /\/\^\\\n.+C/m);

... produces ...

C:\>test.pl Match!

Replies are listed 'Best First'.
Re: Re: Re: Two-dimensional match/regex?
by osfameron (Hermit) on May 22, 2002 at 12:43 UTC
    Yes, I agree that it matches. But also:
    my $target = q{ MM oo < -/ /^\ : C : 8===8 |^| ||| -~-~ }; print "Match!\n" if ($target =~ /\/\^\\\n.+C/m);
    also produces "Match!", which it shouldn't.

    Also,

    my $target=q { MM oo < - ^ ^ /^\ @ @ : C : ( o ) 8===8 `+' |^| O-X-O ||| / \ -~-~ O O }; print "Match!\n" if ($target =~ /\/\^\\\n.+C/m);
    doesn't match.

    The regex doesn't therefore meet the specification of finding one Ascii picture within a larger picture!

    Cheerio!
    Osfameron
    http://osfameron.perlmonk.org/chickenman/