I think the immediate problem is that curlies are re metas. Escape them as:
That's not the only problem, though. Consider the result of applying that to:if ( /if.*?\{/s .. /.*?\}.*?else/s ) { $_ =~ s/\{//; $_ =~ s/\}//; }
You may get some use of Text::Balanced.if (c=e) { call pgme; call pgmd; } if (c=d) { call pgmd; call pgme; } else { call pgmd; call pgmc; }
Update: Added s switch to matching, ++dmmiller2k.
After Compline,
Zaxo
In reply to Re: pattern matching
by Zaxo
in thread pattern matching
by sliles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |