• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter Five. Unification > String Searches and Find Mechanisms

5-4. String Searches and Find Mechanisms

One giant leap for mankind.

Neil Armstrong (1969)

Before going further into LEAP, it is useful to treat the subject of the interface to searches with somewhat more precision. A string is a sequence[6] of characters; ordinary English words and sentences are examples of strings. String searches look through a (usually lengthy) string, called the text, for an instance of a (usually brief) string that the user specifies, called the pattern. Each occurrence of a substring of the text that matches the pattern is called a target. For example, if you were trying to find where you had written of a cat called “little Tatsu” in a long letter, little Tatsu is a good choice of target, and you might choose the briefer string Tatsu as the pattern to use in the search. The match may be exact, may be case-independent, or may represent another relationship between the pattern and the target; they might rhyme, for example. A commonly used matching criterion, one that tests well, is that lowercase letters in the pattern match either uppercase or lowercase letters in the text but that uppercase characters in the pattern match only uppercase characters in the text. Searches usually start from the current cursor location and continue forward through the text. In most systems, a modal user preference setting can direct the search to proceed backward through the text (Figure 5.3).

[6] I use the term sequence as mathematicians do, to mean a set of objects having a first object, a second, and so forth.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint