推荐学习书目
› 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 · 2309 views
    This topic created in 2902 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
    BeliefanX
    Dec 2, 2018
    1
    $ 符号,一般用来匹配结尾~
    itskingname
    itskingname
    Dec 2, 2018 via iPhone
    2
    你不给原文,别人很难帮到你。
    yu13n
    yu13n
    Dec 2, 2018 via Android
    3
    你是想匹配公司名字?感觉正则表达式做不到。要实现的话,得弄个语义词库
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2097 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 11:29 · PVG 19:29 · LAX 03:29 · JFK 06:29
    ♥ Do have faith in what you're doing.