Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

perl -i -pe replacement expression problem

hello I am using the expression

perl5 -i -pe 's/expression/expressionnew/g' *.*

to replace things in a directory.  However I can't seem to figure out how to replace something with a backslash in it itself.  I need to replace:

Mousepads</a> |

with just

</a>

Getting all errors.  How I specify that?

thanks
0
webcs
Asked:
webcs
1 Solution
 
ozoCommented:
perl5 -i -pe 's/Mousepads<\/a> \|/<\/a>/g' *.*
or
perl5 -i -pe 's"Mousepads</a> \|"</a>"g' *.*
0
 
webcsAuthor Commented:
perfect...thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now