想知道是否有更有效的方法来检测字符串是否包含使用正则表达式的一次或多次字母表中的每个字母?字符串中每个字母至少有一次?
我明白任何建议
$str = str_split(strtolower('We promptly judged antique ivory buckles for the next prize'));
$az = str_split('abcdefghijklmnopqrstuvwxyz');
$count = 0;
foreach($az as $alph) {
foreach($str as $z) {
if($alph == $z) {
$count++;
break;
}
}
}
我投票关闭这一问题作为题外话,因为它是关于[codereview.se] – hjpotter92
我不要求我的代码,代码工作回顾。我正在寻求一种使用正则表达式来实现这一点的方法。 – AnchovyLegend
为什么使用正则表达式? – axiac