Using Replace in Mysql with Regex -


i discovered # of records in table field seems have carriage returns. found them using:

select field table field regexp "\r\n" 

i'd remove them using regex in replace did not work:

update table set field=replace(field,regexp "\r\n",'') field regexp "\r\n" 

as aside have found several fields did not match regex query still show in memo field broken e..g

queen  anne 

vs

queen ann 

is there other regex character should adding can search on any/all combinations , replace not getting space?

you want replace():

update table     set field = replace(field, '\r\n', '')     field regexp '\r\n'; 

mysql should recognize '\r' , '\n' in string (see here).


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -