[英]Using Replace in Mysql with Regex
I discovered a # of records in my table where a field seems to have carriage returns. 我在表中发现了一条记录,其中某个字段似乎有回车符。 I found them using:
我发现他们使用:
Select Field from Table WHERE Field REGEXP "\r\n"
I'd like to remove them but using regex in replace did not work: 我想删除它们,但在替换中使用正则表达式不起作用:
Update Table set Field=Replace(Field,REGEXP "\r\n",'') where Field REGEXP "\r\n"
As an aside I have found several fields that did NOT match the regex query but still show up in the memo field as broken e..g 顺便说一句,我发现几个与正则表达式查询不匹配的字段,但仍在备注字段中显示为损坏的例如
Queen
Anne
vs 与
Queen Ann
Is there any other Regex character I should be adding so I can search on any/all combinations and replace where I am not getting simply a space? 我是否应该添加其他正则表达式字符,以便我可以搜索任何/所有组合并替换不只是空格的位置?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.