加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

regex – 如何清除回车和Postgresql中的新行?

发布时间:2020-12-13 16:48:05 所属栏目:百科 来源:网络整理
导读:所有, 我再次卡住了,试图获得我需要它的格式我的数据。我有一个文本字段,看起来像这样。 “deangelo 001 deangelo local origin of name: italain from the american name deangelo meaning: of the angels emotional spectrum ? he is a fountain of joy
所有,

我再次卡住了,试图获得我需要它的格式我的数据。我有一个文本字段,看起来像这样。

“deangelo 001 deangelo

local origin of name: italain

from the american name deangelo

meaning: of the angels

emotional spectrum ? he is a fountain of joy for all.

personal integrity ? his good name is his most precious asset.
personality ? it’s hard to soar with eagles when you’re surrounded by
turkeys! relationships ? starts slowly,but a relationship with
deangelo builds over time. travel & leisure ? a trip of a lifetime
is in his future.

career & money ? a gifted child,deangelo will need to be
challenged constantly.

life’s opportunities ? joy and happiness await this blessed person.

deangelo’s lucky numbers: 12 ? 38 ? 18 ? 34 ? 29 ? 16

最好的办法是在Postgresql中删除回车和换行符?我试过几件事情,没有人想表现。

select regexp_replace(field,E'rc','  ','g') from mytable
    WHERE id = 5520805582

SELECT regexp_replace(field,E'[^()&;/,;*:.&;&;[:space:]a-zA-Z0-9-]',' ')
    FROM mytable
    WHERE field~ E'[^()&;/,;*:.&;&;[:space:]a-zA-Z0-9-]'
    AND id = 5520805582;

提前致谢,
亚当

select regexp_replace(field,E'[nr]+',' ','g' )

阅读手册http://www.postgresql.org/docs/current/static/functions-matching.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读