Automatic Checking of Regular Expressions

被引:7
作者
Larson, Eric [1 ]
机构
[1] Seattle Univ, Seattle, WA 98122 USA
来源
2018 IEEE 18TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM) | 2018年
关键词
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
相关论文
共 21 条
[1]   Can a Machine Replace Humans in Building Regular Expressions? A Case Study [J].
Bartoli, Alberto ;
De Lorenzo, Andrea ;
Medvet, Eric ;
Tarlao, Fabiano .
IEEE INTELLIGENT SYSTEMS, 2016, 31 (06) :15-21
[2]   Automatic Synthesis of Regular Expressions from Examples [J].
Bartoli, Alberto ;
Davanzo, Giorgio ;
De Lorenzo, Andrea ;
Medvet, Eric ;
Sorio, Enrico .
COMPUTER, 2014, 47 (12) :72-80
[3]   RegViz: Visual Debugging of Regular Expressions [J].
Beck, Fabian ;
Gulan, Stefan ;
Biegel, Benjamin ;
Baltes, Sebastian ;
Weiskopf, Daniel .
36TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE COMPANION 2014), 2014, :504-507
[4]  
Bendersky E., 2013, Finite state machines and regular expressions
[5]  
Budiselic I., 2007, EUROCON 2007 INT C C, P2387
[6]  
Chapman C, 2017, IEEE INT CONF AUTOM, P405, DOI 10.1109/ASE.2017.8115653
[7]  
Evans D., 1994, SIGSOFT Software Engineering Notes, V19, P87, DOI 10.1145/195274.195297
[8]   Improving security using extensible lightweight static analysis [J].
Evans, D ;
Larochelle, D .
IEEE SOFTWARE, 2002, 19 (01) :42-+
[9]  
Free Software Foundation, GCC GNU COMP COLL
[10]  
Gimple Software, PC LINT