我正在尝试替换文本中的某些单词。但是,如果单词是url的一部分,则不希望替换该单词。例如:技术一词。它在两个地方都替换了(包括url)。
select regexp_replace('Part of the Technical Network Group https://technical.com/sites/',
'technical','tech',1,0,'i')
from dual
输出:
Part of the tech Network Group https://tech.com/sites/
预期产量:
Part of the tech Network Group https://technical.com/sites/
分两步完成。
首先,如果单词之间存在单词,则第二个单词是句子的第一个单词。
select
regexp_replace(regexp_replace('technical Part of Technical Group https://technical.com/sites/',
' technical',
' tech',1,0,'i'), 'technical ', 'tech ',1,0,'i')
from dual
希望这能解决您的问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句