REGCMP(1) DOMAIN/IX Reference Manual (SYS5) REGCMP(1)
NAME
regcmp - regular expression compile
USAGE
regcmp [ - ] files
DESCRIPTION
Regcmp compiles the regular expressions in file and places
the output in file.i (unless the - option is used, causing
the output to be placed in file.c).
The format of entries in file is a name (C variable) fol-
lowed by one or more blanks, and then a regular expression
enclosed in double quotes.
Regcmp, in most cases, precludes the need for calling regcmp
(3) from C programs. This saves on both execution time and
program size.
The output of regcmp is C source code. Compiled regular
expressions are represented as extern char vectors. There-
fore, file.i files may be included into C programs, or
file.c files may be compiled and later loaded.
In the C program that uses the regcmp output,
regex(abc,line) applies the regular expression named abc to
line.
EXAMPLES
" .nr )I ``216u"n
name ``([A-Za-z][A-Za-z0-9_]*)$0"
telno
``\({0,1}([2-9][01][1-9])$0\){0,1} *"
``([2-9][0-9]{2})$1[ -]{0,1}"
``([0-9]{4})$2"
In the C program that uses the regcmp output,
regex(telno, line, area, exch, rest)
applies the regular expression named telno to line.
DIAGNOSTICS
Self-explanatory.
RELATED INFORMATION
regcmp (3).
Printed 6/10/85 REGCMP-1