ANCHOR
Causes a search to try to match the pattern following ANCHOR starting
at the current character position. If the match does not occur
immediately, the search does not skip over characters looking for a
match.
ANCHOR is a keyword, not a built-in, and has no parameters.
By default, if a search fails to find a match for a pattern, DECTPU
moves the starting position for the search one character in the
direction of the search and starts the search again. If you use ANCHOR
as the first element of a pattern definition, SEARCH does not move the
starting position for the search. This means the search will not match
the pattern unless the pattern is encountered starting at the starting
position of the search.
ANCHOR is useful only as the first element of a complex pattern. It is
legal elsewhere in a pattern definition, but has no effect.
Example
The following assignment statement creates a pattern consisting of a,
1, 2, and 3. If you used pat1 as a parameter to the SEARCH built-in,
the search would not move from character to character looking for the
pattern.
pat1 := ANCHOR + 'a' + '123';
Related Topics
SEARCH SEARCH_QUIETLY UNANCHOR