Solved

perl -i -pe replacement expression problem

Posted on 2002-04-11
2
346 Views
Last Modified: 2006-11-17
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
Comment
Question by:webcs
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 100 total points
ID: 6934414
perl5 -i -pe 's/Mousepads<\/a> \|/<\/a>/g' *.*
or
perl5 -i -pe 's"Mousepads</a> \|"</a>"g' *.*
0
 
LVL 2

Author Comment

by:webcs
ID: 6934519
perfect...thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
cpan issue 1 55
Filtering a file to table 9 98
Perl 101 11 68
ppm conversion to curl on a module install 8 74
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now