use strict; use warnings; my $newUser ='$dummy'; while (<DATA>) { s/O_PREFIX=\w+/O_PREFIX=$newUser/; # s/(?<=O_PREFIX=)\w+/$newUser/; print; } __DATA__ if [ $YOU = 'frog' ] then export OUSER=TNN export CAR=SWs export O_PREFIX=ss export OS=corvette fi
if [ $YOU = 'frog' ] then export OUSER=TNN export CAR=SWs export O_PREFIX=dummy export OS=corvette fi
In reply to Re: REGEX with input file
by Roger
in thread REGEX with input file
by samy1212
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |