我想在我的正则表达式中使用逻辑运算符“AND”。我尝试过以下写法:
(?=exp1)(?=exp2)
但在PHP中,?=
不能使用,需要用PHP语言编写程序。还有其他方法吗?表达式必须匹配所有条件且顺序任意。
我不想写每个排列组合,例如:
(exp1)(exp2)(exp3)|(exp1)(exp3)(exp2)|....
(?=...)
,具体请参考:http://php.net/manual/en/regexp.reference.assertions.php。 - Marc B