This is for my practice, I've a text like:
"lovely heart"<[email protected]>,
"<<*>>Freeeky<<*>> Jack" <[email protected]>,
"heavens's kingk*ng '-'asdf" <[email protected]>
"sample[^-^]"<[email protected]>
I need to extract only:
[email protected]
[email protected]
[email protected]
[email protected]
Here's my try, but still its half or less done.
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, '<(.*@.*)>');
some results are like:
<*>>Freeeky<<*>> Jack" <[email protected]
Any good solution please.
Thanks