我有以下字符串完善的preg_match
Football-Europ,
Football-North
Ice_hockey-NHL
Tennis-xxx
所以我使用的preg_match对这项运动的类型,并采取进一步的步骤...
$sports = "(football|ice_hockey|basketball|tennis|handball|soccer)"
preg_match($rSports,strtolower($link[1]), $sportType);
但我并不需要那个字符串其中包括Live
和American
的字样,我该如何修改preg_match
?
Football-Amreican,
Football-Live,
Tennis-Live,
使用负先行断言的话,你不要''体育=“(足球|冰球|篮球|网球|手球|足球) - (?!美国|活| nhl)”'在哪里短跑 - 只是通过看你的例子 –