Subject: | greedy param regex.. |
Date: | Tue, 3 May 2011 13:20:13 -0500 |
To: | bug-Text-MacroScript [...] rt.cpan.org |
From: | Erin Phillips <ep1 [...] iastate.edu> |
Text::MacroScript v1.38
symptom..
----------- MACRO
%DEFINE .. [$me->{#0}]
----------- BEFORE
..[var]
my @a;
$a[0]=5;
----------- AFTER
$me->{var]
my @a;
$a[0}=5;
s// regex needs non-greedy form or it will pick up LAST closing ']'
--------- NEEDED CHANGE
lines 452, 523, 541, 596, 615, 676
For example..
before..
s{
\Q$name\E
(?:\[(.+)\])?
}{
after..
s{
\Q$name\E
(?:\[(.+?)\])?
}{