Home  >  Q&A  >  body text

python - ?P<sign>.*中的p是什么意思呢

m = re.match(r'(\w+) (\w+)(?P<sign>.*)', 'hello world!')

这句代码中的?P<sign>.*里的p是什么意思?或者给我一篇博客参考下用法。

天蓬老师天蓬老师2741 days ago1248

reply all(3)I'll reply

  • PHPz

    PHPz2017-04-18 09:53:31

    Python Regular Expression Guide

    reply
    0
  • 阿神

    阿神2017-04-18 09:53:31

    Here is another link to learn regular expressions
    Introduction to Python crawler seven regular expressions

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:53:31

    In fact, it means named group in regular expression. You can think of this P as the abbreviation of the word Pattern

    reply
    0
  • Cancelreply