.Oracle字符串替换 替换以M开头的所有字符为空
求一个正则 用的REGEXP_REPLACE 函数
现在我要替换以M开头的所有字符为空
select regexp_replace('MABC','^M(.)*','') from dual
WITH T AS (
SELECT 'M234234324' AS M FROM DUAL UNION ALL
SELECT '123214214' FROM DUAL UNION ALL
SELECT '324234MSDFDSF' FROM DUAL
)
SELECT * FROM T WHERE REGEXP_LIKE(M,'^M'); 单片机温度自动控制系统设计
WITH T AS (
SELECT 'M234234324' AS M FROM DUAL UNION ALL
SELECT '123214214' FROM DUAL UNION ALL
SELECT '324234MSDFDSF' FROM DUAL
)
---^符号表示一个正则表达式的开始,下面正则意思是以M为开头的
--如果^符号出现在[]里面第一个的话,则代表"非"
SELECT * FROM T WHERE REGEXP_LIKE(M,'^M');
M
M234234324