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

Python 抓取的正则问题

  •  
  •   Ewig · Dec 2, 2018 · 1944 views
    This topic created in 2719 days ago, the information mentioned may be changed or developed.
    re.findall('''[u4E00-u9FFF|()()]{5,20}有限公司|[u4E00-u9FFF|()()]{5,20}有限责任公司''',response.text)
    python 匹配的结果是 ['保险经纪公司可以以有限责任公司或股份有限公司']x
    但是我想只匹配 以有限责任公司结尾或者有限公司结尾
    3 replies    2018-12-02 22:58:03 +08:00
    BeliefanX
        1
    BeliefanX  
       Dec 2, 2018
    $ 符号,一般用来匹配结尾~
    itskingname
        2
    itskingname  
       Dec 2, 2018 via iPhone
    你不给原文,别人很难帮到你。
    yu13n
        3
    yu13n  
       Dec 2, 2018 via Android
    你是想匹配公司名字?感觉正则表达式做不到。要实现的话,得弄个语义词库
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3195 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 14:30 · PVG 22:30 · LAX 07:30 · JFK 10:30
    ♥ Do have faith in what you're doing.