REGEXP preg_replace验证模型/零件号


REGEXP preg_replace to Validate Model/Part Numbers

我需要一个脚本,以便能够使用字母数字和"/"(斜杠)和"-"(破折号)在搜索框中查找零件号。以下是目前为止的内容:

$query[] = "(a.name REGEXP '( )*(" . implode("|", explode(" ", preg_replace("/ +/", " ", $basic_search))) . ")( )*')";

/^['w+'-'/]+$/ ?或/^[a-zA-Z0-9'-'/]+$/,因为'w将包含_