Multiple delete tag in html regex

Hello,

I have  a program that inserts tags into html like this:

<img src="msggen/LwedmAsTMPwwCy4ECXv44AMSG5MSG5.png-msgpwidth=320&msgpheight=-1&msgwebwidth=320.png" tppabs="http://url.com/msggen/LwedmAsTMPwwCy4ECXv44AMSG5MSG5.png?msgpwidth=320&msgpheight=-1&msgwebwidth=320" />

I need to delete all the tppabs="http://url.com/msggen/LwedmAsTMPwwCy4ECXv44AMSG5MSG5.png?msgpwidth=320&msgpheight=-1&msgwebwidth=320"

what is the regex I can use for a find and replace program.

Thank you

Fernando
localseoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Marco GasiConnect With a Mentor FreelancerCommented:
$htm = "<img src="msggen/LwedmAsTMPwwCy4ECXv44AMSG5MSG5.png-msgpwidth=320&msgpheight=-1&msgwebwidth=320.png" tppabs="http://url.com/msggen/LwedmAsTMPwwCy4ECXv44AMSG5MSG5.png?msgpwidth=320&msgpheight=-1&msgwebwidth=320" />";
$result = preg_replace('%tppabs.*(?=/>)%im', '', $htm);

Cheers
0
 
localseoAuthor Commented:
But what do I use for find field and then replace field, in program like bbedit?

Thanks
0
 
Marco GasiFreelancerCommented:
I don't know bbedit. Using notepad++ you only need to open Replace panel (menu Search->Replace) check Regular Expression radio button, type in the reg ex, the replacement value and click Replace All.
 Maybe bbedit has something similar...
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Marco GasiFreelancerCommented:
Perhaps this is useful: http://www.journey-of-flight.com/bh_bbedit/how-to/useful_regex/index.php (see paragraph identified by 'image 7')
0
 
localseoAuthor Commented:
thanks, i downloaded notepad++

this should be the regex to use in find?

%tppabs.*(?=/>)%im  still get 0 results though

Thanks
Screen-Shot-2013-01-09-at-21.48..png
0
 
localseoAuthor Commented:
Managed to get it to work,

thanks
0
 
Marco GasiFreelancerCommented:
I'm sorry if I didn't reply to you but I have gone to sleep. Thanks for point. What were wrong the first time? Seeing the screenshot I don't see anything wrong...
0
All Courses

From novice to tech pro — start learning today.