Anybody Work With Databases? Let Me Introduce You to My Little Friend...

Post Reply
 
User avatar
Richard S.
Mayor
Posts: 15183
Joined: Fri. Oct. 01, 2004 8:35 pm
Location: NEPA
Stoker Coal Boiler: Van Wert VA1200
Coal Size/Type: Buckwheat/Anthracite

Post by Richard S. » Wed. May. 03, 2017 7:06 pm

I'm not a database guru and one of the problems I had in the past was doing anything beyond a simple find an replace in MySQL. If there was any kind of wildcard involved I was either doing it with a script, exporting the table and doing it in Notepad++ or some convoluted method using CONCAT or whatever

The new server uses MariaDB which is a fork of MySQL and has this function. REGEXP_REPLACE

Code: Select all

UPDATE tb SET column = REGEXP_REPLACE(column, 'regex/whattofind', 'replacement') 
Regex I know.... BAM! I know you are drooling if you don't have this function.... . :D


Post Reply

Return to “Technology”