我們有這樣的字符串:子字符串的提取物在蜂巢
ABC.XXXXXXX.USD.XX
,任務是提取貨幣(在這種情況下美元)。 選項我想回報廢話:
select distinct
r.name
,regexp_extract(r.name,'\.(.{3})\.',1)
,split(r.name,'\.')
,split(r.name,'\.')[2]
from sales r
輸出:
ABC.XXXXXXX.USD.XX BC. ["","","","","","","","","","","","",""] <empty>
怎麼來的?
可能是由於逃逸?嘗試''\\。'':''\\。(。{3})\\。','split(r.name,'\\。') –