paperbot · PL 论文追踪

全部论文 待读 收藏

P2 RE#: High Performance Derivative-Based Regex Matching with Intersection, Complement, and Restricted Lookarounds

RE#:基于导数的高性能正则表达式匹配,支持交、补与受限环视
POPL 9(POPL)2025匹配度 3/10 · 论文属于正则表达式匹配、符号导数与自动机理论,与用户核心方向(LLM/Agent 与静态分析、浮点程序分析、贝叶斯程序分析)没有直接交集;仅在形式化理论与工程实现结合的偏好上有一定参考价值。引用 12 inbox
Ian Erik Varatalu, Margus Veanes, Juhan Ernits
crossref: 2026-09-10

AI 速览

一句话:提出无回溯的正则匹配工具 RE#,基于符号导数支持交、补与受限环视,匹配复杂度对输入线性。

该论文针对正则表达式匹配中回溯引擎在扩展算子下易出现指数级开销的问题,提出了工具与理论 RE#。RE# 建立在符号导数(symbolic derivatives)之上,不依赖回溯,除经典算子外还支持补、交以及受限环视(restricted lookarounds)。作者对匹配理论进行了形式化开发,证明主匹配算法具有关于输入长度的线性复杂度,并在实验中验证了这一理论复杂度。在流行正则基准上,RE# 比 Rust 中第二快的正则引擎在基线场景下快 71% 以上;在这些基准的扩展版本(启用交、补、环视等算子)上,RE# 相比所有当前最先进引擎往往有数个数量级的性能优势。

问题
传统回溯式正则引擎在支持交、补、环视等扩展算子时,容易出现病态的指数级匹配开销,且难以保证稳定的复杂度。
方法
以符号导数为核心构建无回溯的匹配算法与工具 RE#,形式化其匹配理论,并覆盖补、交与受限环视等扩展算子。
评估
在流行的正则表达式基准及其扩展版本上进行全面评测,并将理论复杂度分析与实测性能对照;与 Rust 及现有最先进引擎比较速度。
原文摘要(Abstract)

We present a tool and theory RE # for regular expression matching that is built on symbolic derivatives, does not use backtracking, and, in addition to the classical operators, also supports complement, intersection and restricted lookarounds. We develop the theory formally and show that the main matching algorithm has input-linear complexity both in theory as well as experimentally. We apply thorough evaluation on popular benchmarks that show that RE # is over 71% faster than the next fastest regex engine in Rust on the baseline, and outperforms all state-of-the-art engines on extensions of the benchmarks often by several orders of magnitude.

链接与引用

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

BibTeX
@article{VarataluVE25,
  title = {RE#: High Performance Derivative-Based Regex Matching with Intersection, Complement, and Restricted Lookarounds},
  author = {Ian Erik Varatalu and Margus Veanes and Juhan Ernits},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {POPL},
  year = {2025},
  doi = {10.1145/3704837}
}