eg8rds has asked for the wisdom of the Perl Monks concerning the following question:
however, if I split the function over multiple line, like it will encounter in the wild, I can't match, even though I've added the -ms to cover multiple lines, like here:my $np; $np= qr{ \{ (?: (?> [^ \{\} ]+) | (??{$np}) )* \} }x; my $text = "functio{1{2*3}}"; my $funcpat = qr/(\w+)($np)/ms; if ($text =~/^$funcpat/ms){ print "\n\nmatches\n"; print "$1\n"; print "$2\n"; print $text;
Has anyone got any ideas as to what is going wrong? Cheers.my $np; $np= qr{ \{ (?: (?> [^ \{\} ]+) | (??{$np}) )* \} }x; my $text = " functio { 1 {2*3} }"; my $funcpat = qr/(\w+)($np)/ms; if ($text =~/^$funcpat/ms){ print "\n\nmatches\n"; print "$1\n"; print "$2\n"; print $text;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: qr//ms problem
by idsfa (Vicar) on Jul 14, 2005 at 14:36 UTC | |
|
Re: qr//ms problem
by Eimi Metamorphoumai (Deacon) on Jul 14, 2005 at 15:01 UTC | |
by ikegami (Patriarch) on Jul 14, 2005 at 15:05 UTC | |
|
Re: qr//ms problem
by blazar (Canon) on Jul 14, 2005 at 14:48 UTC |