高手!请帮忙 一个正则:字符串中包含a、b、c、d、e、f这6个字母中的任意4个或5个字母 高手!请帮忙 一个正则:字符串中包含a、b、c、d、e、f这6个字母中的任意4个或5个字母万谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 感谢大家!!1 字符串中包含a、b、c、d、e、f这6个字母中的任意4个或5个字母(任意位置)2 并且字符串长度不能大于6 $str="adcdel";function filter($str){ preg_match('/^\S{6}$/',$str,$match); if(!empty($match[0])) preg_match('/[a-f]{4,5}/',$match[0],$matchs); return $a=isset($matchs) ? $matchs[0]:null;}$result = filter($str);if($result){ var_dump($result); echo "[[success]]";}else{ echo "[[failed]]";} 岗位名称:PHP开发工程师 memcache 关于magento功能的问题 php如何验证数据库里一个表里面的数据超过5条 请问php程序放在APMServ5.2.6哪目录 jquery autocomplete dede5.5版本 关键词内链修改办法? 如何防治别人直接盗用网站内容 急求一份PHP工作 一个php异或问题,求助,在线等! 织梦网站被挂马iframe找不到在哪挂的,求解决,送分。。。 求php,socket高手,看下这是什么类型的数据格式
1 字符串中包含a、b、c、d、e、f这6个字母中的任意4个或5个字母(任意位置)
2 并且字符串长度不能大于6
$str="adcdel";
function filter($str)
{
preg_match('/^\S{6}$/',$str,$match); if(!empty($match[0]))
preg_match('/[a-f]{4,5}/',$match[0],$matchs);
return $a=isset($matchs) ? $matchs[0]:null;
}$result = filter($str);if($result)
{
var_dump($result);
echo "[[success]]";
}else{
echo "[[failed]]";
}