标签: php preg-match
我的$数据包含"<File label=\"cat.{1,20}>(.*?)</File>"或"<File label=\"dog.{1,20}>(.*?)</File>"或"<File label=\"6969.{1,20}>(.*?)</File>"如何预先匹配这些选项?
"<File label=\"cat.{1,20}>(.*?)</File>"
"<File label=\"dog.{1,20}>(.*?)</File>"
"<File label=\"6969.{1,20}>(.*?)</File>"
preg_match("'<File label=\"cat.{1,20}>(.*?)</File>'si", $data, $url);仅适用于猫。对不起我很难说出来是什么问题:D
preg_match("'<File label=\"cat.{1,20}>(.*?)</File>'si", $data, $url);