Python regex: how to do a negative lookahead with a string which don't start immediately?

前端 未结 1 623
暗喜
暗喜 2021-01-22 08:27

From https://docs.python.org/2/library/re.html#regular-expression-syntax :

(?!...)
Matches if ... doesn’t match next. This is a ne

1条回答
  •  孤独总比滥情好
    2021-01-22 09:03

    Isaac(?!.*Asimov)
    

    Use a negative lookahead for any sequence of characters ending in Asimov. [\s\S] or the DOTALL flag may be appropriate if you want to include newlines in the ..

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