這是我的實踐,我有一個文本,如:Oracle正則表達式提取字符串內標籤
"lovely heart"<[email protected]>,
"<<*>>Freeeky<<*>> Jack" <[email protected]>,
"heavens's kingk*ng '-'asdf" <[email protected]>
"sample[^-^]"<[email protected]>
我只需要提取:
[email protected]
[email protected]
[email protected]
[email protected]
這裏是我的嘗試,但仍然是其一半或更少完成。
WITH t AS
(SELECT '"lovely heart"<[email protected]>,
"<<*>>Freeeky<<*>> Jack" <[email protected]>,
"heavens''s kingk*ng ''-''asdf" <[email protected]>' word
FROM dual
)
SELECT regexp_substr(word, '<(.*@.*)>',1,LEVEL, NULL,1)
FROM t
CONNECT BY level <= regexp_count(word, '<(.*@.*)>');
一些結果是這樣的:
<*>>Freeeky<<*>> Jack" <[email protected]
什麼好的解決辦法,請。
感謝
你是什麼意思了一半呢?這沒有給你預期的結果? –
@RohitJain,更新了意想不到的結果。 – ajmalmhd04