1regcmp(1) User Commands regcmp(1)
2
3
4
6 regcmp - regular expression compile
7
9 regcmp [-] filename...
10
11
13 The regcmp command performs a function similar to regcmp and, in most
14 cases, precludes the need for calling regcmp from C programs. Bypassing
15 regcmp saves on both execution time and program size. The command
16 regcmp compiles the regular expressions in filename and places the out‐
17 put in filename.i.
18
20 − If the − option is used, the output is placed in filename.c.
21 The format of entries in filename is a name (C variable) fol‐
22 lowed by one or more blanks followed by one or more regular
23 expressions enclosed in double quotes. The output of regcmp is
24 C source code. Compiled regular expressions are represented as
25 extern char vectors. filename.i files may thus be #included in
26 C programs, or filename.c files may be compiled and later
27 loaded. In the C program that uses the regcmp output,
28 regex(abc,line) applies the regular expression named abc to
29 line. Diagnostics are self-explanatory.
30
31
33 Example 1 Examples of the regcmp command.
34
35 name "([A−Za−z][A−Za−z0−9_]*)$0"
36
37
38 telno "\({0,1}([2−9][01][1−9])$0\){0,1} *"
39
40 "([2−9][0−9]{2})$1[ −]{0,1}"
41
42 "([0−9]{4})$2"
43
44
45
46 The three arguments to telno shown above must all be entered on one
47 line.
48
49
50
51 In the C program that uses the regcmp output,
52
53
54 regex(telno, line, area, exch, rest)
55
56
57
58
59 applies the regular expression named telno to line.
60
61
63 A general description of the usage of the LC_* environmental variables
64 can be found in environ(5).
65
66 LC_CTYPE Determines how regcmp handles characters. When LC_CTYPE
67 is set to a valid value, regcmp can display and handle
68 text and filenames containing valid characters for that
69 locale.
70
71
72 LC_MESSAGES Determines how diagnostic and informative messages are
73 presented. This includes the language and style of the
74 messages, and the correct form of affirmative and nega‐
75 tive responses. In the "C" locale, the messages are
76 presented in the default form found in the program
77 itself (in most cases, U.S. English).
78
79
81 See attributes(5) for descriptions of the following attributes:
82
83
84
85
86 ┌─────────────────────────────┬─────────────────────────────┐
87 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
88 ├─────────────────────────────┼─────────────────────────────┤
89 │Availability │SUNWtoo │
90 │CSI │Enabled │
91 └─────────────────────────────┴─────────────────────────────┘
92
94 regcmp(3C), attributes(5), environ(5)
95
96
97
98SunOS 5.11 Dec 20 1996 regcmp(1)