• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

a href

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
oostwijk
Asked:
oostwijk
1 Solution
 
ahoffmannCommented:
perl -pe 's#<a href="bliblibli">[^<]*</a>##i;' file
0
 
ozoCommented:
perl -i.bak -pe "s#</?a\b[^>]*># #gi;" file
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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