Regex to match string containing two names in any order

后端 未结 8 2122
忘了有多久
忘了有多久 2020-11-22 05:15

I need logical AND in regex.

something like

jack AND james

agree with following strings

  • \'hi jack here is

8条回答
  •  忘掉有多难
    2020-11-22 05:48

    You can make use of regex's quantifier feature since lookaround may not be supported all the time.

    (\bjames\b){1,}.*(\bjack\b){1,}|(\bjack\b){1,}.*(\bjames\b){1,}
    

提交回复
热议问题