我想问一下是否有人知道如何使用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.
select regexp_replace('The ''quick brown'' fox jumps over the ''lazy'' dog',
'''.*?''', '', 1, 0, 'm')
from dual
OUTPUT
The fox jumps over the dog
了解更多关于regexp_replace
in the docs的信息
对REGEXP_REPLACE使用'n'的“match param”选项告诉它让“匹配任何字符”字符(句点)包含换行符:
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