Regular Expression block negation

前端 未结 1 1109
抹茶落季
抹茶落季 2021-01-24 09:35

I want to find out a string in which a particular tag does not occur, such as:

[\\w]+<[^(unwanted)]>&         


        
相关标签:
1条回答
  • 2021-01-24 10:19
    <xyz>(?:(?!unwanted).)+</xyz>
    

    Matches all chars in <xyz>...</xyz>, but only as long as the expression unwanted doesn't start at any of them.

    0 讨论(0)
提交回复
热议问题