我有以下字符串完善的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)」'在哪裏短跑 - 只是通過看你的例子 –