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

前端 未结 1 604
暗喜
暗喜 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)
提交回复
热议问题