Oracle PL/SQL正则表达式之脱字符caret(^)与中括号square
脱字符(^)放在方括号([])外面表示匹配以方括号([])里面的任何字符开头的字符串;
脱字符(^)放在方括号([])里面表示匹配包含有任何不在方括号([])里面的字符的字符串。
- SQL> select 1 x from dual where regexp_like('0a','^[0-9]');
- X
- ----------
- 1
- SQL> select 1 x from dual where regexp_like('1a','^[0-9]');
- X
- ----------
- 1
- SQL> select 1 x from dual where regexp_like('a0','^[0-9]');
- X
- ----------
- SQL>
- '^[0-9]'匹配以数字开头的。
- -----------------------------------------------------------------
- SQL> select 1 x from dual where regexp_like('111','[^0-9]');
- X
- ----------
- SQL> select 1 x from dual where regexp_like('1a11','[^0-9]');
- X
- ----------
- 1
- SQL> select 1 x from dual where regexp_like('111a','[^0-9]');
- X
- ----------
- 1
- SQL>
- '[^0-9]'匹配包含有不是数字的。
- [0-9]等价于[:digit:]
相关推荐
IT之家 2020-03-11
graseed 2020-10-28
zbkyumlei 2020-10-12
SXIAOYI 2020-09-16
jinhao 2020-09-07
impress 2020-08-26
liuqipao 2020-07-07
淡风wisdon大大 2020-06-06
yoohsummer 2020-06-01
chenjia00 2020-05-29
baike 2020-05-19
扭来不叫牛奶 2020-05-08
hxmilyy 2020-05-11
黎豆子 2020-05-07
xiongweiwei00 2020-04-29
Cypress 2020-04-25
冰蝶 2020-04-20