'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. .TH regcmp 1 "8 Jun 2011" "SunOS 5.11" "User Commands" .SH NAME regcmp \- regular expression compile .SH SYNOPSIS .LP .nf \fBregcmp\fR [\fB-\fR] \fIfilename\fR... .fi .SH DESCRIPTION .sp .LP The \fBregcmp\fR command performs a function similar to \fBregcmp\fR and, in most cases, precludes the need for calling \fBregcmp\fR from C programs. Bypassing \fBregcmp\fR saves on both execution time and program size. The command \fBregcmp\fR compiles the regular expressions in \fIfilename\fR and places the output in \fIfilename\fR\fB\&.i\fR. .SH OPTIONS .sp .ne 2 .mk .na \fB\fB\(mi\fR\fR .ad .RS 8n .rt If the \fB\(mi\fR option is used, the output is placed in \fIfilename\fR\fB\&.c\fR. The format of entries in \fIfilename\fR is a name (C variable) followed by one or more blanks followed by one or more regular expressions enclosed in double quotes. The output of \fBregcmp\fR is C source code. Compiled regular expressions are represented as \fBextern char\fR vectors. \fIfilename\fR\fB\&.i\fR files may thus be \fB#include\fRd in C programs, or \fIfilename\fR\fB\&.c\fR files may be compiled and later loaded. In the C program that uses the \fBregcmp\fR output, \fBregex(abc,line)\fR applies the regular expression named \fBabc\fR to \fBline\fR. Diagnostics are self-explanatory. .RE .SH EXAMPLES .LP \fBExample 1 \fRUsing the \fBregcmp\fR command. .sp .ne 2 .mk .na \fBname\fR .ad .RS 9n .rt \fB"([A\(miZa\(miz][A\(miZa\(miz0\(mi9_]*)$0"\fR .RE .sp .ne 2 .mk .na \fBtelno\fR .ad .RS 9n .rt \fB"\|\e({0,1}([2\(mi9][01][1\(mi9])$0\e){0,1} *"\fR .sp \fB"([2\(mi9][0\(mi9]{2})$1[ \(mi]{0,1}"\fR .sp \fB"([0\(mi9]{4})$2"\fR .RE .sp .LP The three arguments to \fBtelno\fR shown above must all be entered on one line. .sp .LP In the C program that uses the \fBregcmp\fR output, .sp .in +2 .nf regex(telno, line, area, exch, rest) .fi .in -2 .sp .sp .LP applies the regular expression named \fBtelno\fR to \fBline\fR. .SH ENVIRONMENT VARIABLES .sp .LP A general description of the usage of the \fBLC_*\fR environmental variables can be found in \fBenviron\fR(5). .sp .ne 2 .mk .na \fB\fBLC_CTYPE\fR\fR .ad .RS 15n .rt Determines how \fBregcmp\fR handles characters. When \fBLC_CTYPE\fR is set to a valid value, \fBregcmp\fR can display and handle text and filenames containing valid characters for that locale. .RE .sp .ne 2 .mk .na \fB\fBLC_MESSAGES\fR\fR .ad .RS 15n .rt Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses. In the \fB"C"\fR locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English). .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitydeveloper/base-developer-utilities CSIEnabled .TE .SH SEE ALSO .sp .LP \fBregcmp\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5)