regex - Perl statement to change a value in file not working fine -


i need change statement 1 statement 2 in perl not working,.

statement 1 = label ='answerone' statement 2 = suspense 

using below statement not works :

perl -pi -e 's/<label ='answerone'> /suspense/' /home/apanikar/public_html/tests/sub1/chp1/l1/q2.php 

you don't need include <, > symbols.

perl -i -pe "s/\blabel ='answerone'/suspense/g" file 

i think be,

perl -i -pe "s/\\blabel ='answerone'/suspense/g" file 

or

perl -i -pe 's/\blabel ='"'answerone'/suspense/g" file 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -