How to implement a verbose REGEX in Python

前端 未结 2 998
终归单人心
终归单人心 2020-12-30 06:03

I am trying to use a verbose regular expression in Python (2.7). If it matters I am just trying to make it easier to go back and more clearly understand the expression some

2条回答
  •  攒了一身酷
    2020-12-30 06:54

    As say in the comment you should escape your backslash or use raw string even with triple quote.

    verbose_item_pattern = re.compile(r"""
    ...
    

提交回复
热议问题