推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
shyrock
V2EX  ›  Python

这行正则表达式谁给解读一下?r“((?P<w>\d)(?P=w)*)”,先谢了

  •  
  •   shyrock · Jun 23, 2014 · 4554 views
    This topic created in 4484 days ago, the information mentioned may be changed or developed.
    pythonchallenge第十题的一个答案。。。
    8 replies  •  2014-06-24 11:56:13 +08:00
    LazyZhu
        1
    LazyZhu  
       Jun 23, 2014   ❤️ 1
    正则表达式30分钟入门教程 http://deerchao.net/tutorials/regex/regex.htm
    9hills
        2
    9hills  
       Jun 23, 2014
    http://regex101.com/ ,直接吧正则贴进去就好了
    emric
        3
    emric  
       Jun 23, 2014
    shyrock
        4
    shyrock  
    OP
       Jun 23, 2014
    写各位回答,其实主要没看懂那个大写的P是啥意思,教程里面也没有查到。。。谁能说明一下?
    shyrock
        6
    shyrock  
    OP
       Jun 23, 2014
    @LazyZhu 懂了,原来是是python的扩展。。。
    revlis7
        7
    revlis7  
       Jun 24, 2014
    不是python扩展,是分组命名
    shyrock
        8
    shyrock  
    OP
       Jun 24, 2014
    @revlis7 标准re里面命名分组是(?<命名>表达式),这个P是python的扩展,参考5楼的邮件。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2300 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:44 · PVG 15:44 · LAX 00:44 · JFK 03:44
    ♥ Do have faith in what you're doing.