I assume you want to return either $name or '(unknown)' including the () from your regex.
$greet =~ s{#\{(\w+)\((\({0,1}\w+\){0,1})\)\}#}{$obj->{"$1"}->($2)}eg;
In reply to Re: How to cater a self defined escape char in regex ?
by hdb
in thread How to cater a self defined escape char in regex ?
by exilepanda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |