0

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.
4

2 に答える 2

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

于 2015-05-08T06:23:20.690 に答える
0

「n」の「match param」オプションを REGEXP_REPLACE に使用して、「任意の文字に一致」文字 (ピリオド) に改行を含めるように指示します。

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

于 2015-05-08T21:17:40.493 に答える