Abstract

Summary It is difficult to express the definition of the comments of C language in a regular expression. However, the definition can be expressed by a simple regular expression by introducing a special symbol, called the any -symbol, that represents any single character , or by introducing a kind of negation symbol into regular expressions. In general, the problem of string pattern matching can be expressed as such an extended regular expression, and the corresponding finite state automaton generated from the expression is equivalent to the Knuth-Morris-Pratt pattern-matching algorithm [4]. In particular, if we use the any -symbols, the pattern is not restricted to a string of characters. It can be any regular expression. Our method can also be applied to the problem of repeated pattern matching. The Aho-Corasick algorithm [3] can be derived mechanically from an extended regular expression that contains any -symbols.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call