1

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?

Maca
  • 1,659
  • 3
  • 18
  • 42

1 Answers1

1

Try this ?

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

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

w00d
  • 5,416
  • 12
  • 53
  • 85