Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-vsgnj Total loading time: 0 Render date: 2024-07-23T07:31:29.110Z Has data issue: false hasContentIssue false

4 - Extended string matching

Published online by Cambridge University Press:  18 December 2014

Gonzalo Navarro
Affiliation:
Universidad de Chile
Mathieu Raffinot
Affiliation:
Centre National de la Recherche Scientifique (CNRS), Paris
Get access

Summary

Basic concepts

Up to now we have considered search patterns that are sequences of characters. However, in many cases one may be interested in a more sophisticated form of searching. The most complex patterns that we consider in this book are regular expressions, which are covered in Chapter 5. However, regular expression searching is costly in processing time and complex to program, so one should resort to it only if necessary. In many cases one needs far less flexibility, and the search problem can be solved more efficiently with much simpler algorithms.

We have designed this chapter on “extended strings” as a middle point between simple strings and regular expressions. We provide simple search algorithms for a number of enhancements over the basic string search, which can be solved more easily than general regular expressions. We focus on those used in text searching and computational biology applications.

We consider four extensions to the string search problem: classes of characters, bounded length gaps, optional characters, and repeatable characters. The first one allows specifying sets of characters at any pattern or text position. The second permits searching patterns containing bounded length gaps, which is of interest for protein searching (e.g., PROSITE patterns [Gus97, HBFB99]). The third allows certain characters to appear optionally in a pattern occurrence, and the last permits a given character to appear multiple times in an occurrence, which includes wild cards. We finally consider some limited multipattern search capabilities.

Different occurrences of a pattern may have different lengths, and there may be several occurrences starting or ending at the same text position. Among the several choices for reporting these occurrences, we choose to report all the initial or all the final occurrence positions, depending on what is more natural for each algorithm.

In this chapter we make heavy use of bit-parallel algorithms. With some extra work, other algorithms can be adapted to handle some extended patterns as well, but bit-parallel algorithms provide the maximum flexibility and in general the best performance.

Type
Chapter
Information
Flexible Pattern Matching in Strings
Practical On-Line Search Algorithms for Texts and Biological Sequences
, pp. 77 - 98
Publisher: Cambridge University Press
Print publication year: 2002

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Extended string matching
  • Gonzalo Navarro, Universidad de Chile, Mathieu Raffinot, Centre National de la Recherche Scientifique (CNRS), Paris
  • Book: Flexible Pattern Matching in Strings
  • Online publication: 18 December 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781316135228.004
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Extended string matching
  • Gonzalo Navarro, Universidad de Chile, Mathieu Raffinot, Centre National de la Recherche Scientifique (CNRS), Paris
  • Book: Flexible Pattern Matching in Strings
  • Online publication: 18 December 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781316135228.004
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Extended string matching
  • Gonzalo Navarro, Universidad de Chile, Mathieu Raffinot, Centre National de la Recherche Scientifique (CNRS), Paris
  • Book: Flexible Pattern Matching in Strings
  • Online publication: 18 December 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781316135228.004
Available formats
×