paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Testing Regex Generalizability And Its Implications: A Large-Scale Many-Language Measurement Study

测试正则表达式的可推广性及其启示:一项大规模多语言测量研究
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 2/10 · 该论文属于程序语言/软件工程领域的正则表达式实证测量研究,关注跨语言正则特征与提取方法可推广性,与用户核心方向(ML/Agentic 程序静态分析、LLM 辅助静态分析与形式化验证、浮点程序分析、贝叶斯程序分析)没有直接交集。仅可作为 PL 实证方法或正则分析背景参考。引用 19 inbox
James C Davis, Daniel Moyer, Ayaan M Kazerouni, Dongyoon Lee
crossref: 2026-09-12

AI 速览

一句话:通过八项指标和53万余条正则的多语言测量,发现提取方法影响小但语言间正则特征差异显著,警示实证结论可推广性。

正则表达式实践影响软件可维护性、正确性与安全,但既有实证研究很少检验提取方法,且多只基于一两种语言,结论可推广性存疑。作者定义八项指标,刻画正则表示、字符串语言多样性与最坏匹配复杂度,比较两种提取方法,并在537,806条正则的多语言语料上测量。结果显示,两种提取方法得到大体可比的语料,说明较简单方法仍可产生可靠语料;但跨语言比较发现若干正则特征显著不同。因此未来实证研究不能忽略编程语言因素,可推广性并非自动成立;这些测量也为新一代正则工具与引擎的数据驱动设计提供了依据。

问题
既有正则实证研究多基于少量编程语言,且未严格检验正则提取方法,其结论能否跨语言推广尚不明确。
方法
定义八项指标(表示、语言多样性、最坏匹配复杂度),比较两种提取方法,并在537,806条正则的多语言语料上测量。
评估
两种提取方法得到可比语料;跨语言比较发现部分正则特征显著不同,表明可推广性受编程语言影响。
原文摘要(Abstract)

The regular expression (regex) practices of software engineers affect the maintainability, correctness, and security of their software applications. Empirical research has described characteristics like the distribution of regex feature usage, the structural complexity of regexes, and worst-case regex match behaviors. But researchers have not critically examined the methodology they follow to extract regexes, and findings to date are typically generalized from regexes written in only 1-2 programming languages. This is an incomplete foundation. Generalizing existing research depends on validating two hypotheses: (1) Various regex extraction methodologies yield similar results, and (2) Regex characteristics are similar across programming languages. To test these hypotheses, we defined eight regex metrics to capture the dimensions of regex representation, string language diversity, and worst-case match complexity. We report that the two competing regex extraction methodologies yield comparable corpuses, suggesting that simpler regex extraction techniques will still yield sound corpuses. But in comparing regexes across programming languages, we found significant differences in some characteristics by programming language. Our findings have bearing on future empirical methodology, as the programming language should be considered, and generalizability will not be assured. Our measurements on a corpus of 537,806 regexes can guide data-driven designs of a new generation of regex tools and regex engines.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5198,
  title = {Testing Regex Generalizability And Its Implications: A Large-Scale Many-Language Measurement Study},
  author = {James C Davis and Daniel Moyer and Ayaan M Kazerouni and Dongyoon Lee},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00048}
}