Hi Please anyone help me in Reg Exp. I wanted to replace "[%one_two%]" and "[%pne%]" with the value "New" say... I wrote the following code...I am unable to get the output as
"This is a test for New number and New numbers." I am getting it as "This a test for New numbers." WHICH IS WRONG... Please let me know what to do If I need to replace in both... Thanks Anish #!/usr/bin/perl $openTag='\[%'; $closeTag='%\]'; my $count=0; $_= "This is a test for [%one_two%] number and [%pne%] numbers."; s/$openTag.*$closeTag/New/g; print "The new line is:::::: $_ \n";