Information and Media Technologies
Online ISSN : 1881-0896
ISSN-L : 1881-0896
Computing
Checking Time Linearity of Regular Expression Matching Based on Backtracking
Satoshi SugiyamaYasuhiko Minamide
著者情報
ジャーナル フリー

2014 年 9 巻 3 号 p. 222-232

詳細
抄録

Most implementations of regular expression matching in programming languages are based on backtracking. With this implementation strategy, matching may not be achieved in linear time with respect to the length of the input. In the worst case, it may take exponential time. In this paper, we propose a method of checking whether or not regular expression matching runs in linear time. We construct a top-down tree transducer with regular lookahead that translates the input string into a tree corresponding to the execution steps of matching based on backtracking. The regular expression matching then runs in linear time if the tree transducer is of linear size increase. To check this property of the tree transducer, we apply a result of Engelfriet and Maneth. We implemented the method in OCaml and conducted experiments that checked the time linearity of regular expressions appearing in several popular PHP programs. Our implementation showed that 47 of 393 regular expressions were not linear.

著者関連情報
© 2014 Information Processing Society of Japan
前の記事 次の記事
feedback
Top