TRANSREGEX: Multi-modal Regular Expression Synthesis by Generate-and-Repair
Yeting Li, Shuaimin Li, Zhiwu Xu, Jialun Cao, Zixuan Chen, Yun Hu, Haiming Chen, Shing-Chi Cheung
Abstract
Since regular expressions (abbrev. regexes) are difficult to understand and compose, automatically generating regexes has been an important research problem. This paper introduces TransRegex, for automatically constructing regexes from both natural language descriptions and examples. To the best of our knowledge, TransRegex is the first to treat the NLP-and-example-based regex synthesis problem as the problem of NLP-based synthesis with regex repair. For this purpose, we present novel algorithms for both NLP-based synthesis and regex repair. We evaluate TransRegex with ten relevant state-of-the-art tools on three publicly available datasets. The evaluation results demonstrate that the accuracy of our TransRegex is 17.4%, 35.8% and 38.9% higher than that of NLP-based approaches on the three datasets, respectively. Furthermore, TransRegex can achieve higher accuracy than the state-of-the-art multi-modal techniques with 10% to 30% higher accuracy on all three datasets. The evaluation results also indicate TransRegex utilizing natural language and examples in a more effective way.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers8
- Multi-modal program inference: a marriage of pre-trained language models and component-based synthesisKia Rahmani, Mohammad Raza, Sumit Gulwani, Vu Le et al.OOPSLA 2021 · 32 citations
- Exploiting Input Sanitization for Regex Denial of ServiceEfe Barlas, Xin Du, James C. DavisICSE 2022 · 16 citations
- Search-Based Regular Expression Inference on a GPUMojtaba Valizadeh, Martin BergerPLDI 2023 · 11 citations
- InfeRE: Step-by-Step Regex Generation via Chain of InferenceShuai Zhang, Xiaodong Gu, Yuting Chen, Beijun ShenASE 2023 · 8 citations
- Push-Button Synthesis of Watch Companions for Android AppsCong Li, Yanyan Jiang, Chang XuICSE 2022 · 7 citations
Builds on3
- Multi-modal synthesis of regular expressionsQiaochu Chen, Xinyu Wang, Xi Ye, Greg Durrett et al.PLDI 2020 · 81 citations
- FlashRegex: Deducing Anti-ReDoS Regexes from ExamplesYeting Li, Zhiwu Xu, Jialun Cao, Haiming Chen et al.ASE 2020 · 17 citations
- Benchmarking Multimodal Regex Synthesis with Complex StructuresXi Ye, Qiaochu Chen, Isil Dillig, Greg DurrettACL 2020 · 13 citations
Related papers
- Data Extraction via Semantic Regular Expression SynthesisQiaochu Chen, Arko Banerjee, Çagatay Demiralp, Greg Durrett et al.OOPSLA 2023 · 24 citations
- Repairing Regular Expressions for ExtractionNariyoshi Chida, Tachio TerauchiPLDI 2023 · 9 citations
- HISyn: human learning-inspired natural language programmingZifan Nan, Hui Guan, Xipeng ShenFSE 2020 · 12 citations
- Generating Pragmatic Examples to Train Neural Program SynthesizersSaujas Vaduguru, Daniel Fried, Yewen PuICLR 2024 · 7 citations
- RegexScalpel: Regular Expression Denial of Service (ReDoS) Defense by Localize-and-FixYeting Li, Yecheng Sun, Zhiwu Xu, Jialun Cao et al.USENIX Security 2022
