Logical operator AND with php regular expression

后端 未结 2 1050
旧时难觅i
旧时难觅i 2021-02-06 09:46

I\'d like to use a kind of logical operator \"AND\" in my regular expression. I tried this:

(?=exp1)(?=exp2)

But in PHP ?= doesn\'

2条回答
  •  孤城傲影
    2021-02-06 10:32

    In addition to @Tim's answer:

    (?=exp1)(?=exp2)
    

    This can never be true. You say in plain english : make sure that the text followed here is exp1 and also make sure that the text followed here is exp2. No way this is true. It will never match.

提交回复
热议问题