This works: $curline = '...[$variable]...'; # example 1 $curline =~ s/\[\$(.+?)\]/$$1/g; This doesn't: $curline = '...[$hash{'constant'}]...'; # example 2 $curline =~ s/\[\$(.+?)\]/$$1/g;
In reply to Regex Variable Substitution by micronx2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |