Abstract
In the pattern matching problem, there can be a quadratic number of matching substrings in the size of a given text. The linearizing restriction finds, at most, a linear number of matching substrings. We first explore two well-known linearizing restriction rules, the longest-match rule and the shortest-match substring searchrule, and show that both rules give the same result when a pattern is an infix-free set even though they have different semantics. Then, we introduce a new linearizing restriction, the leftmost non-overlapping match rule that is suitable for find-and-replace operations in text searching, and propose an efficient algorithm when the pattern is a regular language according to the new match rule.
The authors were supported under the Research Grants Council of Hong Kong Competitive Earmarked Research Grant HKUST6197/01E.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aho, A.: Algorithms for finding patterns in strings. In: van Leeuwen, J. (ed.) Algorithms and Complexity. Handbook of Theoretical Computer Science, vol. A, pp. 255–300. MIT Press, Cambridge (1990)
Aho, A., Corasick, M.: Efficient string matching: An aid to bibliographic search. Communications of the ACM 18, 333–340 (1975)
Boyer, R.S., Moore, J.S.: A fast string searching algorithm. Communications of the ACM 20(10), 762–772 (1977)
Clarke, C.L.A., Cormack, G.V.: On the use of regular expressions for searching text. ACM Transactions on Programming Languages and Systems 19(3), 413–426 (1997)
Crochemore, M., Hancart, C.: Automata for matching patterns. In: Rozenberg, G., Salomaa, A. (eds.) Linear modeling: background and application. Handbook of Formal Languages, vol. 2, pp. 399–462. Springer, Heidelberg (1997)
Han, Y.-S., Wang, Y., Wood, D.: Prefix-free regular-expression matching. In: Apostolico, A., Crochemore, M., Park, K. (eds.) CPM 2005. LNCS, vol. 3537, pp. 298–309. Springer, Heidelberg (2005)
IEEE. IEEE standard for information technology: Portable Operating System Interface (POSIX): part 2, shell and utilities. IEEE Computer Society Press (September 1993)
Knuth, D., Morris Jr., J., Pratt, V.: Fast pattern matching in strings. SIAM Journal on Computing 6, 323–350 (1977)
Myers, E.W.: A four Russians algorithm for regular expression pattern matching. Journal of the ACM 39(2), 430–448 (1992)
Myers, E.W., Oliva, P., Guim̃araes, K.S.: Reporting exact and approximate regular expression matches. In: Farach-Colton, M. (ed.) CPM 1998. LNCS, vol. 1448, pp. 91–103. Springer, Heidelberg (1998)
Thompson, K.: Regular expression search algorithm. Communications of the ACM 11, 419–422 (1968)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Han, YS., Wood, D. (2005). A New Linearizing Restriction in the Pattern Matching Problem. In: Liśkiewicz, M., Reischuk, R. (eds) Fundamentals of Computation Theory. FCT 2005. Lecture Notes in Computer Science, vol 3623. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11537311_48
Download citation
DOI: https://doi.org/10.1007/11537311_48
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-28193-1
Online ISBN: 978-3-540-31873-6
eBook Packages: Computer ScienceComputer Science (R0)