Oracle 中使用正则表达式

Oracle使用正则表达式离不开这4个函数:

1。regexp_like 

select t3.cert_no from table_name t3 where regexp_like(t3.cert_no, '^(\d{15}|\d{18})$')

2。regexp_substr

SELECT REGEXP_SUBSTR('first field, second field , third field', ', [^,]*,') FROM dual

3。regexp_instr

SELECT REGEXP_INSTR ('hello itmyhome', 'e') FROM dual; 

4。regexp_replace

select regexp_replace('0123456789','01234','abc') from dual;

猜你喜欢

转载自www.cnblogs.com/yinyl/p/11263353.html