regcmp Command
Purpose
Compiles patterns into C language char declarations.
Syntax
regcmp [ - ] File [ File ... ]
Description
The regcmp command compiles the patterns in File and places output in a File.i file, or a File.c file when the - option is specified. The resulting compiled patterns are initialized char declarations. Each entry in File must be a C variable name followed by one or more blanks, followed by a pattern enclosed in " " (double quotation marks).
The output of the regcmp command is C source code. A resulting File.i file can be included in C programs, and a resulting File.c file can be a file parameter to the cc command.
A C language program that uses the output of the regcmp command should use the regex subroutine to apply it to a string.
In most cases, the regcmp command makes unnecessary the use of the regcmp subroutine in a C language program, saving execution time and program size.
Flag
Item | Description |
---|---|
- | Places the output in a File.c file. The default is to put the output in File.i. |
Examples
- To compile the patterns
in stdin1 and the patterns in stdin2, enter:
This creates the stdin1.i and stdin2.i files.regcmp stdin1 stdin2
- To creates stdin1.c and stdin2.c files,
enter:
regcmp - stdin1 stdin2
Note: Assuming that the same stdin1 and stdin2 files are used in both examples, the resulting stdin1.i and stdin1.c files are identical, and the resulting stdin2.i and stdin2.c files are identical.
File
Item | Description |
---|---|
/usr/ccs/bin/regcmp | Contains the regcmp command. |