zoukankan      html  css  js  c++  java
  • 正则表达式

    + 匹配一次及以上
    * 匹配0次及以上
    
    
    SQL> select * from a1;
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    
    SQL> select * from a1 where name like '%abc%';
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    
    
    
    SQL> select * from a1 where regexp_like(name,'abc');
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    
    SQL>  select * from a1 where regexp_like(name,'^abc$');
    
    NAME
    ----------
    abc
    
    'abc' 等价于 like '%abc%'
    
    
    SQL> select * from a1;
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    ab
    
    SQL> select * from a1 where regexp_like(name,'abc+');
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    
    
    SQL>  select * from a1 where regexp_like(name,'z*');
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    ab
    
    SQL> select * from a1 where regexp_like(name,'1*');
    
    NAME
    ----------
    abc
    abcdef
    abcccc
    ab
    匹配0个或者多个1
    
    
    select * from a1 where regexp_like(name,'16*');
    相当于
    
    select * from a1 where name like '%1%'

  • 相关阅读:
    vijos1776:关押罪犯
    vijos1774:机器翻译
    vijos1775:乌龟棋
    vijos1792:摆花
    vijos1100:加分二叉树
    vijos1706:舞会
    单调栈
    bzoj1677:求和
    bzoj1340: [Baltic2007]Escape逃跑问题
    bzoj4716: 假摔
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352145.html
Copyright © 2011-2022 走看看