grep has a -w option which instructs it to match on a whole word only. I want a similar option when using perl with the -pe options but it is not clear how to approach the desired effect.
grep has a -w option which instructs it to match on a whole word
Share
Try putting “\b” before and after your expression. \b represents word boundary in perl
So if your command is
it will become