当我想让preg match停止,当它达到“何”或“<”。我怎样才能做到这一点?preg_match PHP的各种情况
我试过使用[Ho <],但它不起作用,因为它做“H”或“o”或“<”。
谢谢。
例子:
if(preg_match('/class="PuntoVentaDireccion">(.*?)[Ho<].*?Ventas\((.*?)\)</is', $info_tienda, $data)){
echo $data[1];
echo $data[2];
}
不知道你的 “制作预浸比赛_stop_” 的意思。 –
你有没有一个字符串前后的例子? –
你的正则表达式'[Ho <]'不起作用,因为一个字符类允许其中的任何字符,例如, 'H','o',**或**'<'。这就是字符类的设计。 http://www.regular-expressions.info/charclass.html – chris85