Find and Replace using Perl for a dynamic url based on wordpress post

Posted by user1068544 on Stack Overflow See other posts from Stack Overflow or by user1068544
Published on 2011-11-28T01:27:25Z Indexed on 2011/11/28 1:49 UTC
Read the original article Hit count: 166

Filed under:
|

How do you find the following div using perl. The url and image location will consistently change based on the post url, so i need to use a wild card.

I must use a regular expression because I am limited in what i can use due to the software i am using. http://community.autoblogged.com/entries/344640-common-search-and-replace-patterns

<div class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjumpinblack.com%2F2011%2F11%2F25%2Fdrake-and-rick-ross-you-only-live-once-ep-mixtape-2011-download%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjumpinblack.com%2F2011%2F11%2F25%2Fdrake-and-rick-ross-you-only-live-once-ep-mixtape-2011-download%2F&amp;source=jumpinblack1&amp;style=compact&amp;b=2" height="61" width="50" /><br /> </a> </div>

I tried using

<div class="tweetmeme_button" style="float: right; margin-left: 10px;">.*<\/div>

© Stack Overflow or respective owner

Related posts about perl

Related posts about Wordpress