数据形式如下:
   大家好
   大家好!
   大家好abd
   大家好123
   大家好,。
   大家好,12
   大家好abc,。
   大家好abc123
1、匹配出既含汉字又含字母的结果,如:大家好abd
2、匹配出含汉字和字母之外的字符,如:大家好!
                                     大家好123
                                     大家好,。
                                     大家好,12
                                     大家好abc,。
                                     大家好abc123

解决方案 »

  1.   

    关键是汉字的范围里面要去掉这些符号,是很繁琐的一件事情.......4e00-9fa5中文字符   
    FF10-FF19全角0-9,   
    FF21-FF3A全角A-Z,   
    FF41-FF5A全角a-z   
    0021-002F 003A-0040 英文标点   
    FF01-FF0F FF1A-FF20 中文标点 
      

  2.   


    --第一种
    SQL> with t(col) as(
      2  select '大家好' from dual
      3  union all select '大家好!' from dual
      4  union all select '大家好abd' from dual
      5  union all select '大家好123' from dual
      6  union all select '大家好,。' from dual
      7  union all select '大家好,12' from dual
      8  union all select '大家好abc,。' from dual
      9  union all select '大家好abc123' from dual
     10  )
     11  select col from t
     12   where length(col)=length(regexp_replace(col,'([[:punct:]]|[[:digit:]])',''))
     13   and regexp_like(col,'[a-zA-Z]+')
     14   and length(col)<>lengthb(col);COL                                                                             
    ------------------------------------                                            
    大家好abd      
      

  3.   


    --第二种
    SQL> with t(col) as(
      2  select '大家好' from dual
      3  union all select '大家好!' from dual
      4  union all select '大家好abd' from dual
      5  union all select '大家好123' from dual
      6  union all select '大家好,。' from dual
      7  union all select '大家好,12' from dual
      8  union all select '大家好abc,。' from dual
      9  union all select '大家好abc123' from dual
     10  )
     11  select col from t
     12   where length(col)<>length(regexp_replace(col,'([[:punct:]]|[[:digit:]])',''));COL                                                                             
    ------------------------------------                                            
    大家好!                                                                        
    大家好123                                                                       
    大家好,。                                                                      
    大家好,12                                                                      
    大家好abc,。                                                                   
    大家好abc123                                                                    已选择6行。
      

  4.   


    --脚本1
    select col from t
    where length(col)=length(regexp_replace(col,'([[:punct:]]|[[:digit:]])',''))
    and regexp_like(col,'[a-zA-Z]+')
    and length(col)<>lengthb(col);
    --脚本2
    select col from t
    where length(col)<>length(regexp_replace(col,'([[:punct:]]|[[:digit:]])',''));