paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Derivative Based Nonbacktracking Real-World Regex Matching with Backtracking Semantics

基于导数的、具有回溯语义的真实世界非回溯正则匹配
PLDI 7(PLDI)2023匹配度 3/10 · 论文在形式化验证与工业落地(.NET 7)方面符合用户对理论+工程、工业案例的偏好,但主题是正则表达式匹配算法与自动机/形式语义,与用户核心关注的 ML/Agent 程序静态分析、LLM 辅助形式化验证、浮点程序分析、贝叶斯程序分析均无直接交集。引用 21 inbox
Dan Moseley, Mario Nishio, Jose Perez Rodriguez, Olli Saarikivi, Stephen Toub, Margus Veanes, Tiki Wan, Eric Xu
crossref: 2026-09-10

AI 速览

一句话:提出基于导数的非回溯正则匹配算法,支持锚点与计数并保持回溯语义,已在 .NET 7 实现并形式验证。

针对传统回溯正则引擎在最坏情况下可能指数级超时,而现有非回溯引擎又难以兼容回溯语义的问题,本文提出基于导数的非回溯正则匹配理论与算法。该算法支持锚点与计数,保持回溯语义,并可扩展 lookaround。作者给出算法正确性的形式化证明,并描述以正则重写系统为核心的实现。该实现作为 .NET 的新正则后端,随 .NET 7 正式发布过程经过广泛测试;论文还在工业案例与其他正则引擎上进行了综合评估。

问题
回溯正则匹配存在最坏情况指数级超时风险,而非回溯方案往往不支持锚点、计数、lookaround,且难以保持回溯语义。
方法
作者提出基于导数的非回溯匹配算法,用正则重写系统在 .NET 中实现,并给出算法正确性的形式化证明。
评估
新后端随 .NET 7 发布经过广泛测试,并在工业案例与其他正则引擎上进行了综合评估。
原文摘要(Abstract)

We develop a new derivative based theory and algorithm for nonbacktracking regex matching that supports anchors and counting, preserves backtracking semantics, and can be extended with lookarounds. The algorithm has been implemented as a new regex backend in .NET and was extensively tested as part of the formal release process of .NET7. We present a formal proof of the correctness of the algorithm, which we believe to be the first of its kind concerning industrial implementations of regex matchers. The paper describes the complete foundation, the matching algorithm, and key aspects of the implementation involving a regex rewrite system, as well as a comprehensive evaluation over industrial case studies and other regex engines.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1996,
  title = {Derivative Based Nonbacktracking Real-World Regex Matching with Backtracking Semantics},
  author = {Dan Moseley and Mario Nishio and Jose Perez Rodriguez and Olli Saarikivi and Stephen Toub and Margus Veanes and Tiki Wan and Eric Xu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591262}
}