【发布时间】:2020-03-27 19:01:31
【问题描述】:
如果我的列(attribute9)包含Pika~Chu~(040)-121-12334~pika78@pika.com 的字段,我该如何提取像
contact = Pika Chu
phone_nbr = (040)-121-12334
email = pika78@pika.com
我写过类似的代码
regexp_replace(attribute9, '[^()[:digit:]- ]', '') phone_nbr,
regexp_substr (attribute9,'[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}') email,
replace(SUBSTR (attribute9 ,0,(INSTR (attribute9 , '(', -1)) - 1),'~',' ') contact
在 phone_nbr 中,我也得到了电子邮件中的所有数字(即 78)。如何仅在值之间提取(~,~)
【问题讨论】:
-
regexp_replace(attribute9, '[^()[:digit:]-]', '') shipto_phone_nbr, regexp_substr (attribute9,'[A-Za-z0-9._%+-] +@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}') 电子邮件,替换(SUBSTR (attribute9 ,0,(INSTR (attribute9 , '(', - 1)) - 1),'~',' ') shipto_contact,这是代码......为了更好地理解......请帮助我
-
您的列中的顺序是否始终相同?即首先
contact然后phonenbr然后email由~分隔?或者它可以按任何顺序?
标签: sql oracle regexp-replace regexp-substr