Using regex to match string between two strings while excluding strings

后端 未结 6 1891
隐瞒了意图╮
隐瞒了意图╮ 2020-12-06 19:41

Following on from a previous question in which I asked:

How can I use a regular expression to match text that is between two strings, where those two

6条回答
  •  一个人的身影
    2020-12-06 20:23

    You can replace .*? with

     ([^u]|u[^n]|un[^w]|unw[^a]|unwa[^n]|unwan[^t]|unwant[^e]|unwante[^d])*?
    

    This is a solution in "pure" regex; the language you are using might allow you to use some more elegant construct.

提交回复
热议问题