Preg match text in php between html tags

前端 未结 3 592
抹茶落季
抹茶落季 2020-11-29 06:22

Hello I would like to use preg_match in PHP to parse the \"Desired text\" out of the following from a html document

Desired text &

3条回答
  •  感情败类
    2020-11-29 06:22

    What if the string you're matching has multiple lines and is:

    Desired text1

    Desired text2

    Desired text3

    That pattern would match once, and the match would be everything in the string.

    I think a better pattern is:

    "'

    ([^<]*)

    'si"

提交回复
热议问题