Hi I have a small problem in finding and replacing text in a field. I know how to use UPADTE command and have lookup up regexp, but I can not combine them together. I wish to change every occurrence of a myfield in mytable that has got QF in it to change it to GFI. a typical data is : abcQFxyz to chnage to abcQFIxyz. I got as far as: UPDATE mytable SET myfield = QFI WHERE part_number REGEXP 'QF'; but I know that wrong. Thanks for your help.
Hi I have another problem now. How can I only replace all the records that starts with QF0, QF1, QF2, (i.e. QF[0-9]) with QFI. I have tried this, but I know its wrong. update 'pn_pdf' SET 'part_number'= REPLACE (part_number,'regexp(^QF[0-9])','QFI') ; Code (markup): many thanks
hi Please check this http://www.php-groupies.de/blogs/archives/17-Regular-Expression-Functions-for-MySQL.html Regards Alex