Regex to find two words on the page

后端 未结 5 1916
無奈伤痛
無奈伤痛 2021-01-30 11:04

I\'m trying to find all pages which contain words \"text1\" and \"text2\". My regex:

text1(.|\\n)*text2 

it doesn\'t work..

5条回答
  •  天命终不由人
    2021-01-30 11:26

    text0[\s\S]*text1
    

    Try this.This should do it for you.

    What this does is match all including multiline .similar to having .*? with s flag.

    \s takes care of spaces,newlines,tabs \S takes care any non space character.

提交回复
热议问题