【问题标题】:regexp_replace only captures first instanceregexp_replace 仅捕获第一个实例
【发布时间】:2021-02-07 11:55:09
【问题描述】:

我正在尝试使用 regexp_replace(name,'[.]','') 从像 B.J. Smith 这样的名称中删除两个句点,但它只是删除了第一个句点。我也尝试了regexp_replace(player,'([.])','') 无济于事。

【问题讨论】:

标签: postgresql


【解决方案1】:

使用g 标志全局替换匹配项。

regexp_replace('B.J. Smith', '\.', '', 'g')

【讨论】:

    猜你喜欢
    • 2018-06-04
    • 2015-04-19
    • 2021-03-05
    • 1970-01-01
    • 1970-01-01
    • 2021-04-23
    • 1970-01-01
    • 2020-08-19
    • 1970-01-01
    相关资源
    最近更新 更多