[Help] Update mysql table with replace function with regular expression

view story

http://www.linuxquestions.org – Hi everybody! I have a table 'posts' with id,message fields. I want to update table 'posts'. In field 'message', I want to replace text 'http://domain.com/threads/xxx#post123456' by 'http://domain.com/posts/123456' How can I use SQL update with REPLACE function like below: update posts set message=REPLACE(message, 'http://domain.com/*#post[\d]+', 'http://domain.com/posts/$1'); I try this, but it isn't correct :( If this isn't correct, please tell me how to update all post in table 'posts' Thank you very much :p (HowTos)