Index Menus Panels Troubleshooting Glossary Key glossary
Moving around Selection ASCII panel Undo & Repeat Advanced Binaries
Text search methodsText 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.
- If the status/input line is switched off (in the
size and gadgets panel, quick search will
not be incremental; that is it will pop up a box where you can
enter a target word, and searching will not begin until you click
OK or Cancel.
- During incremental search, you can press Tab to
`complete' the entered target string. For example, if you typed
lawn
and there are 5 occurrences of the word lawn in the
text, each followed by mower, your target will be completed to
lawnmower
, and Edith will tell you that there are 5 matching
targets. Completion is done one word at a time.
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
- the replacements are set only when a search action or sequence
of search actions was started from the Search engine; not in
quick search mode, and not when the mark lines option is
selected.
- Sometimes it is more convenient to combine single target search
with Repeat dribble (Edit menu, Ctrl R). Modify the first target by hand, and modify
subsequent targets using repeat.
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