2 .\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH REGCMP 1 "Dec 20, 1996"
8 regcmp \- regular expression compile
12 \fBregcmp\fR [\fB-\fR] \fIfilename\fR...
18 The \fBregcmp\fR command performs a function similar to \fBregcmp\fR and, in
19 most cases, precludes the need for calling \fBregcmp\fR from C programs.
20 Bypassing \fBregcmp\fR saves on both execution time and program size. The
21 command \fBregcmp\fR compiles the regular expressions in \fIfilename\fR and
22 places the output in \fIfilename\fR\fB\&.i\fR.
30 If the \fB\(mi\fR option is used, the output is placed in
31 \fIfilename\fR\fB\&.c\fR. The format of entries in \fIfilename\fR is a name (C
32 variable) followed by one or more blanks followed by one or more regular
33 expressions enclosed in double quotes. The output of \fBregcmp\fR is C source
34 code. Compiled regular expressions are represented as \fBextern char\fR
35 vectors. \fIfilename\fR\fB\&.i\fR files may thus be \fB#include\fRd in C
36 programs, or \fIfilename\fR\fB\&.c\fR files may be compiled and later loaded.
37 In the C program that uses the \fBregcmp\fR output, \fBregex(abc,line)\fR
38 applies the regular expression named \fBabc\fR to \fBline\fR. Diagnostics are
44 \fBExample 1 \fRExamples of the \fBregcmp\fR command.
51 \fB"([A\(miZa\(miz][A\(miZa\(miz0\(mi9_]*)$0"\fR
60 \fB"\|\e({0,1}([2\(mi9][01][1\(mi9])$0\e){0,1} *"\fR
62 \fB"([2\(mi9][0\(mi9]{2})$1[ \(mi]{0,1}"\fR
64 \fB"([0\(mi9]{4})$2"\fR
69 The three arguments to \fBtelno\fR shown above must all be entered on one line.
73 In the C program that uses the \fBregcmp\fR output,
78 regex(telno, line, area, exch, rest)
85 applies the regular expression named \fBtelno\fR to \fBline\fR.
87 .SH ENVIRONMENT VARIABLES
90 A general description of the usage of the \fBLC_*\fR environmental variables
91 can be found in \fBenviron\fR(5).
98 Determines how \fBregcmp\fR handles characters. When \fBLC_CTYPE\fR is set to a
99 valid value, \fBregcmp\fR can display and handle text and filenames containing
100 valid characters for that locale.
106 \fB\fBLC_MESSAGES\fR \fR
109 Determines how diagnostic and informative messages are presented. This includes
110 the language and style of the messages, and the correct form of affirmative and
111 negative responses. In the "C" locale, the messages are presented in the
112 default form found in the program itself (in most cases, U.S. English).
118 See \fBattributes\fR(5) for descriptions of the following attributes:
126 ATTRIBUTE TYPE ATTRIBUTE VALUE
133 \fBregcmp\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5)