How do i perform the following :

During my Wordpress website, i wish to replace something within the publish content

All cases of : http://play.videolog.tv/videos/xx/xx/yyyyyy.flv

Replace : [videolog]yyyyyy[/videolog]

xx could be two or three numbers, but yyyyyy is definitely 6 amounts.

Example :

http://play.videolog.tv/videos/93/80/398682.flv to [videolog]398682[/videolog]

It requires some string miracle to get this done entirely in MySQL. In my opinion this will work:

UPDATE posts_table
SET posts_table.post_text = REPLACE(posts_table.post_text, @full_url := MID(posts_table.post_text, @url_start := LOCATE('http://play.videolog.tv/videos/', posts_table.post_text), LOCATE('.flv', posts_table.post_text, @url_start) + 4 - @url_start), 
CONCAT('[videolog]', MID(@full_url, LENGTH(@full_url) - LOCATE('/', REVERSE(@full_url)) + 2, 6), '[/videolog]'))
WHERE LOCATE('http://play.videolog.tv/videos/', posts_table.post_text)

You can look at it with this particular query:

SELECT REPLACE(posts_table.post_text, @full_url := MID(posts_table.post_text, @url_start := LOCATE('http://play.videolog.tv/videos/', posts_table.post_text), LOCATE('.flv', posts_table.post_text, @url_start) + 4 - @url_start), 
CONCAT('[videolog]', MID(@full_url, LENGTH(@full_url) - LOCATE('/', REVERSE(@full_url)) + 2, 6), '[/videolog]')) AS `result`
FROM posts_table
WHERE LOCATE('http://play.videolog.tv/videos/', posts_table.post_text)

Just replace posts_table and publish_text using the correct table/column names.

This question should replace all cases of that URL, even when it's in the center of a lot of text.

Update:

update MyTable
set MyColumn = concat('[videolog]', replace(SUBSTRING(SUBSTRING_INDEX(MyColumn, '/', -1), 2), '.flv', '[/videolog]'))
where MyColumn like 'http://play.videolog.tv/videos/%'