推荐学习书目
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
qanniu
V2EX  ›  Python

请教各位 正则表达式 别名 子串 匹配的问题?

  •  
  •   qanniu · Nov 7, 2015 · 2949 views
    This topic created in 3848 days ago, the information mentioned may be changed or developed.
    想用别名来匹配这样的字符串里面的
    sum=4.375000
    发现不加别名可以,加了别名就无法匹配了?
    用如下表达式无效?? 为什么呢?
    sum=(?P<sum>(\d+(\.\d+)?))

    用如下表达式(移除别名)可以
    sum=(\d+(\.\d+)?)

    sum=((\d+(\.\d+)?))


    ========================

    sum=(?P<sum>\d+) 能匹配到
    sum=4
    3 replies    2015-11-08 16:22:02 +08:00
    purensong
        1
    purensong  
       Nov 7, 2015
    没用过 python ,不过看懂了题主的意思,帮顶
    qanniu
        3
    qanniu  
    OP
       Nov 8, 2015 via iPhone
    感谢,是我用的编辑器问题,感谢回复,找到这个好用的在线监测工具
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5413 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 06:54 · PVG 14:54 · LAX 23:54 · JFK 02:54
    ♥ Do have faith in what you're doing.