Automatic Checking of Regular Expressions

被引:7
|
作者
Larson, Eric [1 ]
机构
[1] Seattle Univ, Seattle, WA 98122 USA
关键词
regular expressions; software bug detection; testing;
D O I
10.1109/SCAM.2018.00034
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Regular expressions are extensively used to process strings. The regular expression language is concise which makes it easy for developers to use but also makes it easy for developers to make mistakes. Since regular expressions are compiled at runtime, the regular expression compiler does not give any feedback on potential errors. This paper describes ACRE - Automatic Checking of Regular Expressions. ACRE takes a regular expression as input and performs 11 different checks on the regular expression. The checks are based on common mistakes. Among the checks are checks for incorrect use of character sets (enclosed by []), wildcards (represented by.), and line anchors (boolean AND and $). ACRE has found errors in 283 out of 826 regular expressions. Each of the 11 checks found at least seven errors. The number of false reports is moderate: 46 of the regular expressions contained a false report. ACRE is simple to use: the user enters a regular expressions and presses the check button. Any violations are reported back to the user with the incorrect portion of the regular expression highlighted. For 9 of the 11 checks, an example accepted string is generated that further illustrates the error.
引用
下载
收藏
页码:225 / 234
页数:10
相关论文
共 50 条
  • [1] Checking Determinism of Regular Expressions with Counting
    Chen, Haiming
    Lu, Ping
    DEVELOPMENTS IN LANGUAGE THEORY (DLT 2012), 2012, 7410 : 332 - 343
  • [2] Checking determinism of regular expressions with counting
    Chen, Haiming
    Lu, Ping
    INFORMATION AND COMPUTATION, 2015, 241 : 302 - 320
  • [3] A PROCEDURE FOR CHECKING EQUALITY OF REGULAR EXPRESSIONS
    GINZBURG, A
    JOURNAL OF THE ACM, 1967, 14 (02) : 355 - &
  • [4] Automatic Repair of Regular Expressions
    Pan, Rong
    Hu, Qinheping
    Xu, Gaowei
    D'Antoni, Loris
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (OOPSLA):
  • [5] Control-flow checking via regular expressions
    Benso, A
    Di Carlo, S
    Di Natale, G
    Prinetto, P
    Tagliaferri, L
    10TH ASIAN TEST SYMPOSIUM, PROCEEDINGS, 2001, : 299 - 303
  • [6] Static Analysis for Checking the Disambiguation Robustness of Regular Expressions
    Mamouras, Konstantinos
    Le Glaunec, Alexis
    Li, Wu Angela
    Chattopadhyay, Agnishom
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (PLDI):
  • [7] Model checking interval temporal logics with regular expressions ?
    Bozzelli, Laura
    Molinari, Alberto
    Montanari, Angelo
    Peron, Adriano
    INFORMATION AND COMPUTATION, 2020, 272 (272)
  • [8] Algorithms for Checking Intersection Non-emptiness of Regular Expressions
    Su, Weihao
    Li, Rongchen
    Peng, Chengyao
    Chen, Haiming
    THEORETICAL ASPECTS OF COMPUTING, ICTAC 2023, 2023, 14446 : 216 - 235
  • [9] Automatic Synthesis of Regular Expressions from Examples
    Bartoli, Alberto
    Davanzo, Giorgio
    De Lorenzo, Andrea
    Medvet, Eric
    Sorio, Enrico
    COMPUTER, 2014, 47 (12) : 72 - 80
  • [10] Model Checking CTMDP against Temporal Specifications Characterized by Regular Expressions
    Niu, Jun
    Zeng, Guosun
    Niu, Jun
    Zhan, Weihua
    2013 FOURTH WORLD CONGRESS ON SOFTWARE ENGINEERING (WCSE), 2013, : 107 - 111