# $find-words(5)

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

## NAME

$find-words - Filtered word list

## SYNOPSIS

$find-words word

## DESCRIPTION

$find-words must first be initialized to the required filter string, if the variable is evaluated before it is initialized the value will be set to "ABORT" and the command will fail.

The filter string can contain wild-card characters compatible with most file systems, namely:-

?

Match any character.

[abc]

Match character only if it is a, b or c.

[a-d]

Match character only if it is a, b, c or d.

[^abc]

Match character only if it is not a, b or c.

*

Match any number of characters.

Note that these are not the same characters used by exact(2m) mode.

Once initialized, evaluating $find-words returns the next word found in the main spell dictionaries which matches the filter until no more words are found, in which case an empty string is returned.

## EXAMPLE

The following example finds all the words with "foo" in it (e.g. "footnote"), printing them to the massage line one at a time. Note that &set(4) is used on the !while(4) statement to avoid evaluating $find-words twice per loop.

    set-variable $find-words "*foo*"
    !while &not &seq &set #l0 $find-words ""
        100 ml-write &cat "Word: " #l0
    !done

## NOTES

The order of the words is undefined.

Due to the way words are derived, it is possible to have two or more copies of a word in the dictionary. If this is a matching word $find-words will return the word two or more times.

## SEE ALSO

spell(2).

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

</HMTL>