日期:2014-05-17  浏览次数:20965 次

正则表达式
select regexp_instr('but, soft! what light through yonder windows breaks?','l[[:alpha:]]{4}')
as result from dual中{4}是什么意思?
与select regexp_instr('but, soft! what light through yonder windows breaks?','l[[:alpha:]]')
as result from dual返回结果一致。

------解决方案--------------------
SQL code

select regexp_instr('but, soft! what light through yonder windows breaks?',
                    'l[[:alpha:]]{4}') as result  --匹配l[[:alpha:]]{4}表示l后面有4个字母
  from dual
       
select regexp_instr('but, soft! what light through yonder windows breaks?',
                    'l[[:alpha:]]') as result   --匹配l[[:alpha:]]后面一个字母
  from dual