beautypg.com

1 using pattern built-in procedures and keywords, 2 using keywords to build patterns – Compaq DEC Text Processing Utility AA-PWCBD-TE User Manual

Page 52

background image

DEC Text Processing Utility Data Types
3.7 Pattern Data Type

for the pattern, the built-in returns a range that contains the text that matches
the pattern. You can assign the range to a variable.

The following example uses strings and pattern operators to create a pattern that
is stored in the variable my_pat. The variable is then used with the SEARCH
or SEARCH_QUIETLY built-in procedure in a forward direction. If SEARCH
or SEARCH_QUIETLY finds a match for my_pat, the range of matching text is
stored in the variable match_range. The POSITION built-in procedure causes the
editing point to move to the beginning of match_range.

my_pat := ("abc" | "def") + "::";
match_range := SEARCH (my_pat, FORWARD);
POSITION (match_range);

3.7.1 Using Pattern Built-In Procedures and Keywords

The following built-in procedures return values of the pattern data type:

ANY

ARB

MATCH

NOTANY

SCAN

SCANL

SPAN

SPANL

See the DEC Text Processing Utility Reference Manual for a complete description
of these pattern built-in procedures.

3.7.2 Using Keywords to Build Patterns

You can use the following keywords as the first argument to the SEARCH or
SEARCH_QUIETLY built-in procedures. You can also use them to form patterns
in expressions that use the pattern operators. See the DEC Text Processing
Utility Reference Manual
for a complete description of these keywords.

ANCHOR

BUFFER_BEGIN

BUFFER_END

LINE_BEGIN

LINE_END

PAGE_BREAK

REMAIN

UNANCHOR

3–12 DEC Text Processing Utility Data Types