<a href
当它不在模式之间时,我试图a>
用 "group1" 替换单词 "group" 。下面的查询替换了所需模式中的“组”。如何替换模式之外的单词?
with t as (
select '<a href Part of the technical Network Group www.tech.com/sites/ hh a> group' as text from dual
union all select '<a href mean www.tech.technical Network a>' as text from dual
union all select 'www.tech.tech///technical <a href Network Group a>' as text from dual)
select regexp_replace(text,'group','group1',1,0,'i')
from t
WHERE REGEXP_LIKE(text,'<a href.*group.*a>','i')
第一行的预期输出是(“组”一词出现在模式的内部和外部)。期望只是替换外面的那个)
<a href Part of the technical Network group www.tech.com/sites/ hh a> group1