views:

17

answers:

1

Hi,

In my <mt:EntryBody> text I have few urls which I want to change the pointing address.

http://www.myblog.com/blog/content/fruit/apple.html

to

http://www.myblog.com/blog/apple/

In this case word "fruit" and "apple" would be the variable. I would like to use regex_replace modifier to change every URL in EntryBody.

How would I write this?

+1  A: 

Try this ?

<mt:EntryBody regex_replace="/content\/\w*\/([^\.]*)\.html/","$1/">

$1 will get the info from what matched inside "( )"

iKid
it worked! Thanks!
Maca