PHP学习之路六(php与正则表达式)
程序员文章站
2023-12-26 14:40:15
...
正则表达式和样式匹配 "; }else { echo "匹配失败!
"; } if ($result1){ echo "\byou\b/"."匹配成功!
"; }else { echo "\byou\b/"."匹配失败!
"; } ?> "; } if(ereg("^李兴乐",$string)){//判断行首是否为李兴乐 echo '李兴乐为第一个
'; } if(ereg("^王长超",$string)){ echo "王长超为第一个
"; } if(ereg("小黑$",$string)){ //判断行尾 是否为 小黑 echo "小黑为最后一个
"; } ?> "; }else { echo $myemail."格式不正确,请重新输入!
"; } ?> "; }else { echo "时间格式错误!
"; } ?> "; print_r($matches); echo "
"; }else { echo "PHP was not found.
"; print_r($matches); echo "
"; } ?>