Index  Menus  Panels  Troubleshooting  Glossary  Key glossary
Moving around  Selection  ASCII panel  Undo & Repeat  Advanced  Binaries

Text search methods

Text search methods

Searching in Edith is divided into two facilities: the fast, incremental quick search-only method and the more elaborate search engine, which allows for replacement and wildcard/pattern search.

QUICK SEARCHING

To search for a single word once, literally and quickly, use Quick search below... (
Browse menu, Ctrl Q) or Quick search above... (Browse menu, Ctrl P). By default, quick search is incremental, which is to say that as you enter the search target, Edith will start searching for the first occurrence immediately. Moreover, you can hit Tab to automatically `complete' the search target string.

Quick search marks the line containing the first target found in either direction, and leaves the cursor at the beginning of the matched occurrence in the text. To find further targets, use Next target below (Browse menu, Ctrl G) or Next target above (Browse menu, Ctrl D). To search for multiple targets, use the search engine.

THE SEARCH ENGINE

To search for multiple targets, targets containing newlines, wildcard expressions, and for automatic substitution, use the Search engine... (
Browse menu, Ctrl F).

SEARCH PARAMETERS

Select first if you want to highlight single targets, or all if all matching targets should be highlighted simultaneously. Select mark lines if instead of the targets, entire lines containing the targets should be selected. When lines are marked, the replacement function is disabled. Choose the direction in which you want to search by clicking above or below. If you preselected a number of lines in the text window, there will be a third option: in selected region, which performs a so-called confined search.

One or more targets can be entered into the upper text field. The grey button left of the text field will switch between single target search and simultaneous search for four targets.

Select expression if the targets contain wildcard patterns (see below for a list of wildcard patterns), or literal text otherwise.

Select case sensitive: both if upper and lower case should be distinguished, or case sensitive: none if they should be considered equal. You can also search `caps-sensitive'; this means that an upper case character in the target expression will never match a lower case character, but a lower case character in the search expression is allowed to match an upper case letter in the text.

The home button moves the text cursor to the beginning of the file.

Each target has a substitute string or pattern associated to it. Switch between a target and its substitute using the Tab key.

TO SEARCH

After entering the parameters, click search or OK. Depending on the parameters, the first target, or all matching targets below or above the text cursor will be highlighted.

TO REPLACE

There is no single `search and replace' operation. Instead, the substitutes for the highlighted targets are stored in the cut buffer during the search operation. To replace the highlighted targets, press the replace button or select replace (Ctrl H).

The contents of the cut buffer can be inspected by opening the Cut/replace buffer (Windows menu, Shift Ctrl B).

NOTES

SPECIAL FACILITIES

Because there is a separate search all option, the search engine is good for more than simple search and replace actions. It can also be used to mark a number of targets and perform some other operation on the resulting selection, e.g. Delete (Edit menu, Alt Shift X), Sort (Text menu, Alt Shift O), Shift right (Text menu, Ctrl K) and Repeat dribble (Edit menu, Ctrl R).

WILDCARD EXPRESSIONS

Use wildcard patterns (select the expression switch) to search for targets which are not literally the same, but match some general pattern with a number of `holes'. You should also choose expression if you want to match newlines or true tabs. The following characters have a special meaning in the target and substitute expressions when wildcards are enabled (they will be rendered in red, green and blue in the search engine panel):

Target expression

?, !
Match any character, but no line feeds or carriage returns; ! stores the matched character as tag 0.
*
Match any string of zero or more characters, not including line feeds or carriage returns
[a-z], [abcd]1, [0-9a-fA-F]!
Match precisely one occurrence of a-z, any of a, b, c or d, etc. May optionally be followed by an exclamation mark or the digit 1. The first stores the matched character as tag 0; the latter is an escape, useful if the character to follow is one of the wildcards ?, * or !.
[^a-z]
Match any character not in a-z (always case sensitive), but no newlines.
[a-z]*, [a-z]+, [a-z]?
Match zero or more, one or mode, zero or one characters in a range.
^
Match the beginning of a line
$
Match the end of a line
\<, \>
Match the beginning/end of a word
\n, \t
Match a newline or a tab (also inside patterns). As newline is CR, CR/LF or LF.
\c
Match the character c literally
\( subexpression \)
Marks part of the string for use in the replacement.
:
Stands for `or' at full expression level (i.e., subexpression grouping is not possible).
&0
Match the character previously matched by ! or a range followed by an exclamation mark.
&1, ..., &9
Match the string matched by the first up to ninth subexpression tagged by \( and \).
&i/range1/range2/
As above but in the string matched, all characters in range1 are substituted by those that have the same position in range2.
Substitute expression
&0
The character previously matched by ! or a range followed by an exclamation mark. Optionally followed by a range substitution as in the search expression.
&1, ..., &9
The string matched by the first up to ninth subexpression tagged by \( and \). Optionally followed by a range substitution as in the search expression.
\n, \t
Newline, tab.
\c
The character c literally.

REPEATED SEARCH

To continue a single-target search, select Next target below (Browse menu, Ctrl G) or Next target above (Browse menu, Ctrl D). All below, all above, multi-target and confined search can only be done from the search engine panel.
Index  Menus  Panels  Troubleshooting  Glossary  Key glossary
Moving around  Selection  ASCII panel  Undo & Repeat  Advanced  Binaries