0

I need to replace this whole html that is wrapped in p tags

<p class="tumble"><a href='http://www.website.com/autologin.aspx?userid=4JLJufWQ%3d%3d&bookid=87' >
    <img src="http://images.website.com/images/P/image.jpg" alt="cover" /><em>Book</em> - Author</a></p>

with

<p class="tumble"><embed src="http://daily.website.com/todaybook.aspx" width="258" height="320" /></p>

Is there an easy way to do this mass replace. The links and information inside the p tag are different and it would take me weeks to do replace one by one.

Any ideas?

user5248
  • 347
  • 1
  • 3
  • 21

1 Answers1

0

You need to mix string search with a regular expression. There's a really nice official article breaking this down.

Your search string will be something like this:

<p class="tumble">[^]*</p>
Serg Chernata
  • 12,280
  • 6
  • 32
  • 50
  • There is one problem with this solution, It does not understand which to end at, so it replaces not just content that is wrapped in inside the "tumble" class p tags, but where the last is in the document. Am I making sense? – user5248 Jan 23 '17 at 18:14