search

Home  >  Q&A  >  body text

python - 正则表达式匹配和原生字符的问题

>>> m = re.search(r'\\\d','\8')
>>> if m is not None: m.group()

'\\8'

有哪位朋友能看得懂这个是怎么匹配出来的吗?能解释一下吗?

>>> m = re.search(r'\\\d','\\8')
>>> if m is not None: m.group()

'\\8'
阿神阿神2784 days ago500

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:25:59

    if m is not None: print(m.group())


    Your questions are all about the basic knowledge of python’s re module

    Press F1 to read the user manual.

    reply
    0
  • Cancelreply