python version 3.4 does not support a 'ur' prefix

前端 未结 3 595
孤街浪徒
孤街浪徒 2021-02-07 09:26

I have some python code writen in an older version of python(2.x) and I struggle to make it work. I\'m using python 3.4

_eng_word = ur\"[a-zA-Z][a-zA-Z0-9\'.]*\         


        
3条回答
  •  北恋
    北恋 (楼主)
    2021-02-07 10:08

    http://bugs.python.org/issue15096

    Title: Drop support for the "ur" string prefix
    When PEP 414 restored support for explicit Unicode literals in Python 3, the "ur" string prefix was deemed to be a synonym for the "r" prefix.

    So, use 'r' instead of 'ur'

提交回复
热议问题