广告关键词屏蔽,正则匹配qq遇到一问题


   
  $str="qq:223423423";
  
preg_match("/[0-9]{5,}/",$str);
//这样可以匹配成功。

//但我想匹配这样的过滤,"qq:2 2 3 4 2 3 4 2 3",也可能是"qq 2-2-3-4-2-3-4-2-3",但我写这样的正则:
preg_match("/[0-9,\s,-]{5,}/",$str);
//为什么匹配不上呢?

正则表达式 php

muriko 12 years ago

REX格式错误....

   
  preg_match("/[0-9|\s|-]{5,}/",$str);
 

IceMoon answered 12 years ago

Your Answer