标题: 正则练习
时间: 2013-01-13
<?php $str=$_POST['str'];
$preg=$_POST['preg'];
$r=$_POST['r'];
if($_GET['form']!=""){
if($_POST['v']=="replace"){
preg_replace($preg,$r,$str,$x);
echo '<div class=posit>字符串:</div><div class=sb_tb>'.$_POST['str'].'</div><div class=posit>结果:</div><div class=sb_tb>'.$x.'</div>';
}
if($_POST['v']=="match"){
preg_match_all($preg,$str,$x) or die("匹配错误");
echo '<div class=posit>字符串:</div><div class=sb_tb>'.$_POST['str'].'</div><div class=posit>结果:</div><div class=sb_tb>'.$x[0].'</div>';
}
}
正则练习哪里错了『回复列表(3|隐藏机器人聊天)』