oracle正则的使用

2014-11-24 15:03:32 · 作者: · 浏览: 0

oracle正则的使用
[sql]
问题、讲A010A中的10取出
--第一个方式to_number regexp_substr
SQL> select to_number(regexp_substr('A010A','[0-9]+')) from dual;
www.2cto.com
TO_NUMBER(REGEXP_SUBSTR('A010A
------------------------------
10
Executed in 0.016 seconds
--第二个方式、regexp_replace
SQL> select regexp_replace('010','^0','') from dual;
REGEXP_REPLACE('010','^0','')
-----------------------------
10
Executed in 0.031 seconds