Regex to match the first ending HTMl tag

前端 未结 3 453
醉酒成梦
醉酒成梦 2021-01-14 21:00

I am trying to write a regex which match the first ending form tag.

  [^~]* 

The above regex

3条回答
  •  一整个雨季
    2021-01-14 21:23

    Use a real parser like DOMDocument, SimpleXML or SimpleHTMLDOM. Regular expressions are not suitable for parsing non-regular languages like HTML.

提交回复
热议问题