Compiles patterns into C language char declarations.
regcmp [ - ] File [ File ... ]
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.
- | Places the output in a File.c file. The default is to put the output in File.i. |
regcmp stdin1 stdin2This creates the stdin1.i and stdin2.i files.
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.
/usr/ccs/bin/regcmp | Contains the regcmp command. |
The regcmp or regex subroutine.
The Subroutines Overview in AIX General Programming Concepts: Writing and Debugging Programs.