Solved

a href

Posted on 2002-07-14
2
237 Views
Last Modified: 2010-03-05
I've got a html file which contains lines with <a href="blablabla">interesting text</a>

How can I open this html file and delete all occurences of <a href="bliblibli"> and </a>

"blablabla and bliblibli are just examples, it are random words.

0
Comment
Question by:oostwijk
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 7153836
perl -pe 's#<a href="bliblibli">[^<]*</a>##i;' file
0
 
LVL 84

Expert Comment

by:ozo
ID: 7153979
perl -i.bak -pe "s#</?a\b[^>]*># #gi;" file
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 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