I need to match cat and replace brave with frightened
while (<DATA>){ next unless /\bcat\b/i; s/brave/frigthened/; print $_; } __DATA__ My Cat is brave but ocicat is also brave and dog is brave catwoman wonderbrave
You can achieve similar results using grep
In reply to Re: need help in editing multiple word in a file
by pvaldes
in thread need help in editing multiple word in a file
by vkp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |