English

Translation of Regular Expression with Lookahead into Finite State Automaton

Formal Languages and Automata Theory 2026-08-04 v1 Programming Languages

Abstract

Most of the conventional implementations of regular expressions are based on backtracking. Such implementations are slow in the worst case, and thus, we would like to develop a better matching algorithm. However, it is nontrivial to provide an efficient matching algorithm that can deal with practical extensions including submatch addressing. This paper studies regular expression with lookaheads and negative lookaheads, abbreviated to REwLA. First, we propose a transformation from a REwLA of size mm to a deterministic finite automaton of \mrO(22m)\mr{O}(2^{2^m}) states. Next, we consider weighted regular expressions, which enable us to calculate submatch addressing. We propose a transformation from a weighted REwLA of size mm to a weighted nondeterministic finite automaton of \mrO(22m)\mr{O}(2^{2^m}) states.

Keywords

Cite

@article{arxiv.2608.03167,
  title  = {Translation of Regular Expression with Lookahead into Finite State Automaton},
  author = {Akimasa Morihata},
  journal= {arXiv preprint arXiv:2608.03167},
  year   = {2026}
}

Comments

This article is author's unofficial English translation of: A. Morihata, "Sakiyomi tsuki seikihyougen no yuugenjoutai ohtomaton heno henkan'', (Computer Software, Vol. 29, No. 1, pp. 147--158, 2012, in Japanese. ). See "Note Added in Translation" for detail