oracle数据库regexp_substr函数用法

select regexp_substr('abc,def,ghf,zxc,qwe','[^,]+',2,3) from dual;--ghf
select regexp_substr('abc,def,ghf,zxc,qwe','[^,]+',2,1) from dual;--bc
select regexp_substr('abc,def,ghf,zxc,qwe','[^,]+',6,1) from dual;--ef
select regexp_substr('abc,def,ghf,zxc,qwe','[^,]+',6,2) from dual;--ghf

第一个参数是源字符串、

第二个参数是截取的正则表达式

第三个参数是从源字符串的第几个字符串开始计算

第四个参数是截取后,取第几个值作为返回

 

posted @ 2022-01-24 18:57  5miyuan  阅读(609)  评论(0)    收藏  举报