Regular Expressions with Numerical Occurrence Indicators - preliminary results.
Pekka Kilpeläinen, Rauno Tuhkanen · 2003
Regular expressions with numerical occurrence indicators (#REs) are used in established text manipulation tools like Perl and Unix egrep, and in the recent W3C XML Schema Definition Language. Numerical occurrence indicators do not increase the expressive power of regular expressions, but they do increase the succinctness of expressions by an exponential factor. Therefore methods based on straightforward translation of #REs into corresponding standard regular expressions are computationally infeasible in the general case. We report some preliminary results about computational problems related to efficient matching and comparison of #REs. Matching, or membership testing of languages described by #REs, is shown to be tractable. Simple comparison problems (inclusion and overlap) of #REs are shown to be NP-hard. We also consider simple #REs consisting of a single symbol and nested numerical occurrence indicators only, and derive a simple numerical test for the membership of a word in the language described by a simple #RE.