我有一个字符串
with xx as (
select 'id9' idno,'untest X456789,W357987 and Q321089 cont group' test from dual)
select * from xx
有一些像下面这样的行
IDNO | TEST
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
id9 | untest X456789,W357987 and Q321089 cont group
我想提取以字母开头后跟 6 位数字的单词。另外,它们之间应该有一个逗号(因为稍后我会将它们放在多行中)
结果表:
IDNO | TEST
+++++++++++++++++++++++++++++++++++++++++
id9 | X456789,X321678,W357987,Q321089
我已经尝试过regexp_replace
,但无法找到解决方案。
select idno, REGEXP_replace( test,'([^[A-Z]{1}[:digit:]{6},?])') AS test from xx