A word match is a match to a sequence of characters that ends with, but does not include, a delimiting character. Spaces, tabs, field-separators, and ends of line are the default delimiting characters. The delimiting characters can be redefined, as described in “Customizing the delimiter” on page 67.

The following script is an example of a word pattern that is a match of all characters up to, but not including the delimiter. The second time the rule is evaluated, the pattern matching starts with the delimiter. The second word match fails because there are no characters found before the delimiter is found.

ASL Script (word_match.asl):
START {
 a:word
}
do {
 print("Matched with ".a);
}
DEFAULT {
 ..eol
}
do {
 print("Failed match");
}
Input (word_match.txt):
city state country
Output:
$ sm_adapter --file=word_match.txt word_match.asl
Matched with city
Failed match
$