Regex - I only want to match the start tags in regex

后端 未结 5 1508
醉话见心
醉话见心 2021-01-06 23:36

I am making a regex expression in which I only want to match wrong tags like:

*some text here, some other tags may be here as well but no ending \'p\' tag* &

5条回答
  •  春和景丽
    2021-01-07 00:17

    I know this isn't likely (or even html-legal?) to happen in this case, but a generic unclosed xml-tag solution would be pretty difficult as you need to consider what would happen with nested tags like

    OUTER BEFORE

    INNER

    OUTER AFTER

    I'm pretty sure the regular expressions given so-far would match the second

    there, even though it is not actually an unclosed

    .

提交回复
热议问题