# narrow-search-forward(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

narrow-search-forward - Search for a string in the forward direction
narrow-search-backward - Search for a string in the backward direction

## SYNOPSIS

n narrow-search-forward "string" (C-c s)
n narrow-search-backward "string" (C-c r)

## DESCRIPTION

narrow-search-forward searches for a string from the current cursor position to the end of the file and will open up and search through narrow(2m) regions to search for the string. This differs from the search-forward(2) command that does not search through narrow regions.

The string is typed on the bottom line of the screen, and terminated with the `<ESC>` key. Special characters can be typed in by preceding them with a `^Q`. A single `^Q` indicates a null string. On successive searches, hitting `<ESC>` alone causes the last search string to be reused.

Searching is affected by magic(2m) mode, which allows regular expression pattern matching, and exact(2m) mode which makes the search case sensitive.

The numeric argument n is interpreted as follows:-

n > 0

The nth occurrence of the string is located.

n < 0

The first occurrence of the string is located in the next n lines.

narrow-search-backward searches backwards in the file. In all other ways it is like narrow-search-forward.

## DIAGNOSTICS

The command returns a status of `FALSE` if the string could not be located (or nth string where n occurrences are requested). If the string is found within the given search criteria the return status is `TRUE`.

## SEE ALSO

buffer-mode(2), exact(2m), hunt-backward(2), hunt-forward(2), isearch-forward(2), magic(2m), replace-string(2). search-forward(2),
Regular Expressions

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>