字段如下
group_name
滁州e8-11套餐88元每月(2M)
滁州e8-11套餐68元每月(1M)我想用正则表达式匹配 后面的这个档位,我是这么写的
select regexp_substr(group_name,'[0-9][0-9]*[0-9]') from dual
但是得出的结果却是11 他把前面的那e8-11的11截取下来了,
如果我想要后面的档位改怎么做
group_name
滁州e8-11套餐88元每月(2M)
滁州e8-11套餐68元每月(1M)我想用正则表达式匹配 后面的这个档位,我是这么写的
select regexp_substr(group_name,'[0-9][0-9]*[0-9]') from dual
但是得出的结果却是11 他把前面的那e8-11的11截取下来了,
如果我想要后面的档位改怎么做
------------------------------
88
-------
8852323SQL>
SELECT
regexp_replace('滁州e8-11套餐88元每月(2M)', '.*(\d\d).*(\d\d).*(\d[mM]).*', '\1 \2 \3')
FROM dual;
group_name
滁州新e8基础包128元
电视版)月付我的e家尊享e8套餐基础包168元
滁州E6套餐基础包-46元
滁州e8-11套餐78元每月(1M)
select regexp_substr(group_name,'[0-9][0-9]*[0-9]',2,2),group_name
from tb_b_ft_ofr_inst_200810 where ofr_type='e8-11'
用这个方法的话只能解决 滁州e8-11套餐78元每月(1M) 这个类型的,上面三个都截取不数字
,再想请教下 regexp_substr(group_name,'[0-9][0-9]*[0-9]',2,2)这函数后面的2是什么含义
取那个钱的话,都是 ****+元正则:select rtrim(regexp_substr('滁州e8-11套餐78元每月(1M) ', '\d+[元]'), '元')
from dual; select regexp_substr('滁州e8-11套餐78元每月(1M) ', '\d+[元]')
from dual;