V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
xinali
V2EX  ›  Python

python 正则表达式相关

  •  
  •   xinali · 2016-07-18 19:14:24 +08:00 · 2143 次点击
    这是一个创建于 2845 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在阅读 sqlmap 源码时,有个爬虫的代码的一段正则表达式

    tags = re.finditer(r'(?si)<a[^>]+href="(?P<href>[^>"]+)"', content) 
    

    这个正则表达式的(?si)表示的是什么意思?

    6 条回复    2016-07-19 10:41:48 +08:00
    Cynic222
        1
    Cynic222  
       2016-07-18 20:19:32 +08:00 via Android
    这是 raw 字符串,?是给)的
    billlee
        2
    billlee  
       2016-07-18 21:32:20 +08:00
    这是 options, s - single line, i - case insensitive
    RTFM
    fzinfz
        3
    fzinfz  
       2016-07-18 23:21:06 +08:00
    dacapoday
        4
    dacapoday  
       2016-07-19 00:56:51 +08:00
    oglop
        5
    oglop  
       2016-07-19 09:15:38 +08:00 via Android
    @dacapoday ls 这是哪个网站解析的
    dacapoday
        6
    dacapoday  
       2016-07-19 10:41:48 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2484 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:05 · PVG 22:05 · LAX 07:05 · JFK 10:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.