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

各位老铁,我是真的没找到资料,我想做一个类似这篇博客文章里面的列出所有正则匹配过程。

  •  
  •   DaFee · Mar 30, 2021 · 3025 views
    This topic created in 2048 days ago, the information mentioned may be changed or developed.

    文章地址: https://blog.doyensec.com/

    This visualisation of the matching steps was produced by emitting verbose debugging from cpython’s regex engine using my cpython fork.
    

    文章当中说是通过 cpython 实现的,但是我用 debug 模式呈现不了他那样的效果。

    7 replies  •  2021-03-31 09:39:56 +08:00
    aloxaf
    aloxaf
    Mar 30, 2021
    1
    regex101
    no1xsyzy
    no1xsyzy
    Mar 30, 2021
    3
    > This visualisation of the matching steps was produced by emitting verbose debugging from cpython’s regex engine using my cpython fork.

    他用了一个自己的 fork,在 regex 引擎中产生了更多的信息。
    DaFee
    DaFee
    OP
    Mar 30, 2021
    4
    @no1xsyzy 我其实就是想知道怎么在 regex 引擎中产生这些信息。。。
    DaFee
    DaFee
    OP
    Mar 30, 2021
    5
    提供点思路就行
    no1xsyzy
    no1xsyzy
    Mar 30, 2021
    6
    https://github.com/bcaller/cpython/compare/fbc7723..2c67561
    还有这个 commit message: https://github.com/bcaller/cpython/commit/bc453d1

    没研究过 CPython 源代码,以下表述来源于技能“直觉 EX+”
    首先,打开 VERBOSE 之类的符号,并且在许多地方嵌入 TRACE
    然后用 spit.py 来 parse 输出。
    DaFee
    DaFee
    OP
    Mar 31, 2021
    7
    @no1xsyzy 好的,谢谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1485 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 01:17 · PVG 09:17 · LAX 17:17 · JFK 20:17
    ♥ Do have faith in what you're doing.