推荐学习书目
› 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 · 2888 views
    This topic created in 2006 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
        1
    aloxaf  
       Mar 30, 2021
    regex101
    phony2r
        2
    phony2r  
       Mar 30, 2021
    no1xsyzy
        3
    no1xsyzy  
       Mar 30, 2021
    > This visualisation of the matching steps was produced by emitting verbose debugging from cpython’s regex engine using my cpython fork.

    他用了一个自己的 fork,在 regex 引擎中产生了更多的信息。
    DaFee
        4
    DaFee  
    OP
       Mar 30, 2021
    @no1xsyzy 我其实就是想知道怎么在 regex 引擎中产生这些信息。。。
    DaFee
        5
    DaFee  
    OP
       Mar 30, 2021
    提供点思路就行
    no1xsyzy
        6
    no1xsyzy  
       Mar 30, 2021
    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
        7
    DaFee  
    OP
       Mar 31, 2021
    @no1xsyzy 好的,谢谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1477 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 16:27 · PVG 00:27 · LAX 09:27 · JFK 12:27
    ♥ Do have faith in what you're doing.