Use the substitution operator s///g like this:
1:30 >perl -wE "my $found = 'ENV{\"VCINSTALLDIR\"}\ATLMFC\LIB\amd64;E +NV{\"LIBPATH\"}'; $found =~ s/ENV{\"(.*?)\"}/\$ENV(\"$1\")/g; say $fo +und;" $ENV("VCINSTALLDIR")\ATLMFC\LIB\amd64;$ENV("LIBPATH") 1:30 >
Within the substitution, the parentheses capture the “value” text which is used in the replacement as $1. The /g modifier tells the regex engine to keep searching and substituting until the string is exhausted.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Search and replace
by Athanasius
in thread Search and replace
by Bharath666
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |