我想问一下是否有人知道如何使用regexp_replace删除pl / sql中单引号之间的字符。
就是这样。
The 'quick brown' fox jumps over the lazy dog.
--> The fox jumps over the lazy dog.
The
'quick
brown'
fox jumps over
'the lazy' dog.
--> The fox jumps over dog.
答案 0 :(得分:1)
select regexp_replace('The ''quick brown'' fox jumps over the ''lazy'' dog',
'''.*?''', '', 1, 0, 'm')
from dual
<强>输出强>
The fox jumps over the dog
详细了解regexp_replace
in the docs
答案 1 :(得分:0)
使用&#34;匹配参数&#34;选项&#39; n&#39;到REGEXP_REPLACE告诉它让&#34;匹配任何字符&#34; character(句号)包括换行符:
select regexp_replace('The ''quick
brown'' fox jumps over the lazy dog', '''.*''', '', 1, 0, 'n')
from dual;
https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions137.htm#SQLRF06302