OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / regex.3
1 .\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Wed Jun 14 16:10:28 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
24 .\" Tiny change in formatting - aeb, 950812
25 .\" Modified 8 May 1998 by Joseph S. Myers (jsm28@cam.ac.uk)
26 .\"
27 .\" Japanese Version Copyright (c) 1998 Takatsugu Nokubi
28 .\"     all rights reserved.
29 .\" Translated 1998-06-30, Takatsugu Nokubi
30 .\" Updated & Modified 2001-11-05, Yuichi SATO <ysato@h4.dion.ne.jp>
31 .\" Updated & Modified 2005-02-24, Yuichi SATO <ysato444@yahoo.co.jp>
32 .\" Updated 2008-08-02, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
33 .\"
34 .\"WORD:        bitwise-or              ¥Ó¥Ã¥È¤´¤È¤ÎOR
35 .\"WORD:        element                 (¹½Â¤ÂÎ)Í×ÁÇ
36 .\"WORD:        collating element       ¾È¹ç½ç½ø¤ÎÍ×ÁÇ
37 .\"
38 .\" show the synopsis section nicely
39 .de xx
40 .in \\n(INu+\\$1
41 .ti -\\$1
42 ..
43 .TH REGEX 3 2008-05-29 "GNU" "Linux Programmer's Manual"
44 .\"O .SH NAME
45 .SH Ì¾Á°
46 .\"O regcomp, regexec, regerror, regfree \- POSIX regex functions
47 regcomp, regexec, regerror, regfree \- POSIX regex ´Ø¿ô
48 .\"O .SH SYNOPSIS
49 .SH ½ñ¼°
50 .nf
51 .B #include <sys/types.h>
52 .B #include <regex.h>
53
54 .BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags );
55
56 .BI "int regexec(const regex_t *" preg ", const char *" string \
57 ", size_t " nmatch ,
58 .BI "            regmatch_t " pmatch[] ", int " eflags );
59
60 .BI "size_t regerror(int " errcode ", const regex_t *" preg ", char *" errbuf ,
61 .BI "                size_t " errbuf_size );
62
63 .BI "void regfree(regex_t *" preg );
64 .fi
65 .\"O .SH DESCRIPTION
66 .SH ÀâÌÀ
67 .\"O .SS "POSIX Regex Compiling"
68 .SS "POSIX regex ¥³¥ó¥Ñ¥¤¥ë"
69 .\"O .BR regcomp ()
70 .\"O is used to compile a regular expression into a form that is suitable
71 .\"O for subsequent
72 .\"O .BR regexec ()
73 .\"O searches.
74 .BR regcomp ()
75 ¤Ï¡¢Àµµ¬É½¸½¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¡¢
76 .BR regexec ()
77 ¤Ç¤Î¸¡º÷½èÍý¤ËŬ¹ç¤¹¤ë·ÁÂ֤ˤ¹¤ë¡£
78
79 .\"O .BR regcomp ()
80 .\"O is supplied with
81 .\"O .IR preg ,
82 .\"O a pointer to a pattern buffer storage area;
83 .\"O .IR regex ,
84 .\"O a pointer to the null-terminated string and
85 .\"O .IR cflags ,
86 .\"O flags used to determine the type of compilation.
87 .BR regcomp ()
88 ¤Ï¥Ñ¥¿¡¼¥ó¤òµ­²±¤¹¤ë¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿
89 .IR preg ¡¢
90 ¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó
91 .IR regex ¡¢
92 ¤½¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤Î·Á¼°¤ò·è¤á¤ë¤¿¤á¤Î¥Õ¥é¥°
93 .I cflag
94 ¤ò°ú¿ô¤Ëȼ¤¦¡£
95
96 .\"O All regular expression searching must be done via a compiled pattern
97 .\"O buffer, thus
98 .\"O .BR regexec ()
99 .\"O must always be supplied with the address of a
100 .\"O .BR regcomp ()
101 .\"O initialized pattern buffer.
102 Á´¤Æ¤ÎÀµµ¬É½¸½¸¡º÷¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¤Ë¤è¤Ã¤Æ¹Ô¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
103 ¤è¤Ã¤Æ¡¢
104 .BR regexec ()
105 ¤Ë»ØÄꤹ¤ë¤Î¤Ï¡¢É¬¤º
106 .RB ( regcomp ()
107 ¤Ë¤è¤Ã¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿) ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥¢¥É¥ì¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
108
109 .\"O .I cflags
110 .\"O may be the
111 .\"O .RB bitwise- or
112 .\"O of one or more of the following:
113 .I cflags
114 ¤Ë¤Ï°Ê²¼¤Ë¼¨¤¹Äê¿ô°ì¤Ä°Ê¾å¤Î¥Ó¥Ã¥È¤´¤È¤Î OR (bitwise-or) ¤ò»ØÄꤹ¤ë¡£
115 .TP
116 .B REG_EXTENDED
117 .\"O Use
118 .\"O .B POSIX
119 .\"O Extended Regular Expression syntax when interpreting
120 .\"O .IR regex .
121 .\"O If not set,
122 .\"O .B POSIX
123 .\"O Basic Regular Expression syntax is used.
124 .I regex
125 ¤Ë
126 .B POSIX
127 ³ÈÄ¥Àµµ¬É½¸½¤ò»ÈÍѤ¹¤ë¡£¤â¤·¤³¤Î¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢
128 .B POSIX
129 ɸ½àÀµµ¬É½¸½¤¬»È¤ï¤ì¤ë¡£
130 .TP
131 .B REG_ICASE
132 .\"O Do not differentiate case.
133 .\"O Subsequent
134 .\"O .BR regexec ()
135 .\"O searches using this pattern buffer will be case insensitive.
136 Âçʸ»ú¾®Ê¸»ú¤Î°ã¤¤¤ò̵»ë¤¹¤ë¡£¤³¤Î¥Õ¥é¥°¤ò»ØÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿
137 ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤òÍѤ¤¤Æ
138 .BR regexec ()
139 ´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¤È¡¢Âçʸ»ú¾®Ê¸»ú¤Î¶èÊ̤òÉÕ¤±¤º¤Ë¸¡º÷¤¬¹Ô¤ï¤ì¤ë¡£
140 .TP
141 .B REG_NOSUB
142 .\"O Support for substring addressing of matches is not required.
143 .\"O The
144 .\"O .I nmatch
145 .\"O and
146 .\"O .I pmatch
147 .\"O arguments to
148 .\"O .BR regexec ()
149 .\"O are ignored if the pattern buffer supplied was compiled with this flag set.
150 ¤³¤Î¥Õ¥é¥°¤òÀßÄꤷ¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤¬
151 .BR regexec ()
152 ¤Î°ú¿ô¤Ë»ØÄꤵ¤ì¤ë¤È¡¢°ú¤­¿ô
153 .IR nmatch ,
154 .I pmatch
155 ¤¬Ìµ»ë¤µ¤ì¤ë¡£
156 .TP
157 .B REG_NEWLINE
158 .\"O Match-any-character operators don't match a newline.
159 Á´¤Æ¤Îʸ»ú¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ë²þ¹Ô¤ò¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£
160
161 .\"O A nonmatching list
162 .\"O .RB ( [^...] )
163 .\"O not containing a newline does not match a newline.
164 ²þ¹Ô¤ò´Þ¤Þ¤Ê¤¤Èó¥Þ¥Ã¥Á¥ó¥°Ê¸»ú¥ê¥¹¥È
165 .RB ( [^...] )
166 ¤Ë²þ¹Ô¤ò¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£
167
168 .\"O Match-beginning-of-line operator
169 .\"O .RB ( ^ )
170 .\"O matches the empty string immediately after a newline, regardless of
171 .\"O whether
172 .\"O .IR eflags ,
173 .\"O the execution flags of
174 .\"O .BR regexec (),
175 .\"O contains
176 .\"O .BR REG_NOTBOL .
177 .BR regexec ()
178 ¤Î¼Â¹Ô»þ¤Ë»ØÄꤹ¤ë¥Õ¥é¥°
179 .I eflags
180 ¤Ë
181 .B REG_NOTBOL
182 ¤ò´Þ¤à¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¹ÔƬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿
183 .RB ( ^ )
184 ¤ò²þ¹Ôľ¸å¤Î¶õʸ»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£
185
186 .\"O Match-end-of-line operator
187 .\"O .RB ( $ )
188 .\"O matches the empty string immediately before a newline, regardless of
189 .\"O whether
190 .\"O .I eflags
191 .\"O contains
192 .\"O .BR REG_NOTEOL .
193 .I eflags
194 ¤Ë
195 .B REG_NOTEOL
196 ¤ò´Þ¤à¤«¤É¤¦¤«¤Ë¤«¤«¤ï¤é¤º¡¢¹ÔËö¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿
197 .RB ( $ )
198 ¤ò²þ¹ÔľÁ°¤Î¶õʸ»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£
199 .\"O .SS "POSIX Regex Matching"
200 .SS "POSIX regex ¥Þ¥Ã¥Á¥ó¥°"
201 .\"O .BR regexec ()
202 .\"O is used to match a null-terminated string
203 .\"O against the precompiled pattern buffer,
204 .\"O .IR preg .
205 .BR regexec ()
206 ¤Ï¡¢
207 ¥×¥ê¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡
208 .I preg
209 ¤ò¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿Ê¸»úÎó¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¡£
210 .\"O .I nmatch
211 .\"O and
212 .\"O .I pmatch
213 .\"O are used to provide information regarding the location of any matches.
214 .I nmatch
215 ¤È
216 .I pmatch
217 ¤Ï¥Þ¥Ã¥Á¥ó¥°¤Î°ÌÃ֤˴ؤ¹¤ë¾ðÊó¤ò¼èÆÀ¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£
218 .\"O .I eflags
219 .\"O may be the
220 .\"O .RB bitwise- or
221 .\"O of one or both of
222 .\"O .B REG_NOTBOL
223 .\"O and
224 .\"O .B REG_NOTEOL
225 .\"O which cause changes in matching behavior described below.
226 .I eflags
227 ¤Ë¤Ï
228 .B REG_NOTBOL
229 ¤È
230 .B REG_NOTEOL
231 ¤Î¤É¤Á¤é¤«¡¢¤â¤·¤¯¤ÏξÊý¤Î¥Ó¥Ã¥È¤´¤È¤Î
232 .BR OR " (bitwise-" or )
233 ¤ò»ØÄꤷ¡¢°Ê²¼¤ÇÀâÌÀ¤¹¤ë¤è¤¦¤Ë¥Þ¥Ã¥Á¥ó¥°Æ°ºî¤òÊѲ½¤µ¤»¤ë¡£
234 .TP
235 .\"O .B REG_NOTBOL
236 .\"O The match-beginning-of-line operator always fails to match (but see the
237 .\"O compilation flag
238 .\"O .B REG_NEWLINE
239 .\"O above)
240 .B REG_NOTBOL
241 ¹ÔƬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ï¡¢É¬¤º¥Þ¥Ã¥Á¤Ë¼ºÇÔ¤¹¤ë (¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥Õ¥é¥°
242 .B REG_NEWLINE
243 ¤Î¹àÌܤ⻲¾È)¡£
244 .\"O This flag may be used when different portions of a string are passed to
245 .\"O .BR regexec ()
246 .\"O and the beginning of the string should not be interpreted as the
247 .\"O beginning of the line.
248 ¤³¤Î¥Õ¥é¥°¤Ï¡¢Ê£¿ô¹Ô¤Ë¤Þ¤¿¤¬¤ëʸ»úÎó¤ò
249 .BR regexec ()
250 ¤Ç¸¡º÷¤¹¤ëºÝ¤Ë¡¢Ê¸»úÎó¤ÎÀèƬ¤ò¹Ô¤ÎÀèƬ¤È¤·¤Æ²ò¼á¤µ¤»¤Ê¤¤¾ì¹ç¤ËÍѤ¤¤ë¡£
251 .TP
252 .\"O .B REG_NOTEOL
253 .\"O The match-end-of-line operator always fails to match (but see the
254 .\"O compilation flag
255 .\"O .B REG_NEWLINE
256 .\"O above)
257 .B REG_NOTEOL
258 ¹ÔËö¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ª¥Ú¥ì¡¼¥¿¤Ï¡¢É¬¤º¥Þ¥Ã¥Á¤Ë¼ºÇÔ¤¹¤ë (¥³¥ó¥Ñ¥¤¥ë»þ¤Î¥Õ¥é¥°
259 .B REG_NEWLINE
260 ¤Î¹àÌܤ⻲¾È)¡£
261 .\"O .SS "Byte Offsets"
262 .SS ¥Ð¥¤¥È¥ª¥Õ¥»¥Ã¥È
263 .\"O Unless
264 .\"O .B REG_NOSUB
265 .\"O was set for the compilation of the pattern buffer, it is possible to
266 .\"O obtain substring match addressing information.
267 ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë
268 .B REG_NOSUB
269 ¤¬ÀßÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢Éôʬʸ»úÎó¤Î¥Þ¥Ã¥Á¥ó¥°°ÌÃÖ¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
270 .\"O .I pmatch
271 .\"O must be dimensioned to have at least
272 .\"O .I nmatch
273 .\"O elements.
274 .I pmatch
275 ¤Ï¡¢¾¯¤Ê¤¯¤È¤â
276 .I nmatch
277 ¤ÎÂ礭¤µ¤ò»ý¤Ä¤è¤¦¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
278 .\"O These are filled in by
279 .\"O .BR regexec ()
280 .\"O with substring match addresses.
281 .\"O Any unused structure elements
282 .\"O will contain the value \-1.
283 .BR regexec ()
284 ¤Î¼Â¹Ô¤Ë¤è¤Ã¤Æ¡¢¤½¤ì¤é¤ËÉôʬʸ»úÎó¥Þ¥Ã¥Á¥ó¥°°ÌÃÖ¾ðÊó¤¬ÂåÆþ¤µ¤ì¤ë¡£
285 ̤»ÈÍѤι½Â¤ÂÎÍ×ÁǤˤϠ\-1 ¤¬ÃͤȤ·¤ÆÂåÆþ¤µ¤ì¤ë¡£
286
287 .\"O The
288 .\"O .I regmatch_t
289 .\"O structure which is the type of
290 .\"O .I pmatch
291 .\"O is defined in
292 .\"O .IR <regex.h> .
293 .I pmatch
294 ¤Î·¿¤Ç¤¢¤ë
295 .I regmatch_t
296 ¹½Â¤ÂΤϡ¢
297 .I <regex.h>
298 Æâ¤ÇÄêµÁ¤µ¤ì¤ë¡£
299
300 .in +4n
301 .nf
302 typedef struct {
303     regoff_t rm_so;
304     regoff_t rm_eo;
305 } regmatch_t;
306 .fi
307 .in
308
309 .\"O Each
310 .\"O .I rm_so
311 .\"O element that is not \-1 indicates the start offset of the next largest
312 .\"O substring match within the string.
313 .\"O The relative
314 .\"O .I rm_eo
315 .\"O element indicates the end offset of the match,
316 .\"O which is the offset of the first character after the matching text.
317 ¹½Â¤ÂÎÍ×ÁÇ
318 .I rm_so
319 ¤ÎÃͤ¬ \-1 ¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤ì¤Ïʸ»úÎóÆâ¤Ç¤Î¼¡¤ÎºÇÂç¤Î¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Î³«»Ï
320 ¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¼¨¤¹¡£¤½¤ì¤ËÂФ·¡¢¹½Â¤ÂÎÍ×ÁÇ
321 .I rm_eo
322 ¤Ï¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Î½ªÎ»¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¼¨¤·¡¢
323 ¥Þ¥Ã¥Á¥ó¥°Éôʬ¤Îľ¸å¤Îʸ»ú¤Î¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤¬»ÈÍѤµ¤ì¤ë¡£
324 .\"O .SH "POSIX Error Reporting"
325 .SS "POSIX ¥¨¥é¡¼¥ì¥Ý¡¼¥È"
326 .\"O .BR regerror ()
327 .\"O is used to turn the error codes that can be returned by both
328 .\"O .BR regcomp ()
329 .\"O and
330 .\"O .BR regexec ()
331 .\"O into error message strings.
332 .BR regerror ()
333 ¤Ï¡¢
334 .BR regcomp ()
335 ¤È
336 .BR regexec ()
337 ¤Î¼Â¹Ô¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë¥¨¥é¡¼¥³¡¼¥É¤«¤é¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤ò
338 ÆÀ¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¡£
339
340 .\"O .BR regerror ()
341 .\"O is passed the error code,
342 .\"O .IR errcode ,
343 .\"O the pattern buffer,
344 .\"O .IR preg ,
345 .\"O a pointer to a character string buffer,
346 .\"O .IR errbuf ,
347 .\"O and the size of the string buffer,
348 .\"O .IR errbuf_size .
349 .BR regerror ()
350 ¤Ï¥¨¥é¡¼¥³¡¼¥É
351 .IR errcode ¡¢
352 ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡
353 .IR preg ¡¢
354 ʸ»úÎó¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿
355 .IR errbuf ¡¢
356 ʸ»úÎó¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º
357 .I errbuf_size
358 ¤ò°ú¿ô¤Ë¤È¤ë¡£
359 .\"O It returns the size of the
360 .\"O .I errbuf
361 .\"O required to contain the null-terminated error message string.
362 .\"O If both
363 .\"O .I errbuf
364 .\"O and
365 .\"O .I errbuf_size
366 .\"O are nonzero,
367 .\"O .I errbuf
368 .\"O is filled in with the first
369 .\"O .I "errbuf_size \- 1"
370 .\"O characters of the error message and a terminating null.
371 ¤³¤Î´Ø¿ô¤Ï¡¢¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸Ê¸»úÎó¤ò³ÊǼ¤¹¤ë¤Î¤ËɬÍפÊ
372 .I errbuf
373 ¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£¤â¤·
374 .I errbuf
375 ¤È
376 .I errbuf_size
377 ¤ÎξÊý¤¬Èó 0 ÃͤǤ¢¤ì¤Ð¡¢
378 .I errbuf
379 ¤Ë¤ÏºÇ½é¤Î
380 .I "errbuf_size \- 1"
381 ʸ»úʬ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤È½ªÃ¼¤Î¥Ì¥ëʸ»ú¤¬¼ý¤Þ¤ë¤è¤¦¤ËÂåÆþ¤µ¤ì¤ë¡£
382 .\"O .SS "POSIX Pattern Buffer Freeing"
383 .SS "POSIX ¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡²òÊü"
384 .\"O Supplying
385 .\"O .BR regfree ()
386 .\"O with a precompiled pattern buffer,
387 .\"O .I preg
388 .\"O will free the memory allocated to the pattern buffer by the compiling
389 .\"O process,
390 .\"O .BR regcomp ().
391 °ú¿ô¤Ë¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡
392 .I preg
393 ¤òÍ¿¤¨¤Æ
394 .BR regfree ()
395 ¤ò¸Æ¤Ó½Ð¤¹¤È¡¢
396 .BR regcomp ()
397 ¤Ë¤è¤ë¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤¬²òÊü¤µ¤ì¤ë¡£
398 .\"O .SH "RETURN VALUE"
399 .SH ÊÖ¤êÃÍ
400 .\"O .BR regcomp ()
401 .\"O returns zero for a successful compilation or an error code for failure.
402 .BR regcomp ()
403 ¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë¤ÎÀ®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¼ºÇÔ»þ¤Ë¤Ï¥¨¥é¡¼¥³¡¼¥É¤òÊÖ¤¹¡£
404
405 .\"O .BR regexec ()
406 .\"O returns zero for a successful match or
407 .\"O .B REG_NOMATCH
408 .\"O for failure.
409 .BR regexec ()
410 ¤Ï¡¢¥Þ¥Ã¥Á¥ó¥°¤ÎÀ®¸ù»þ¤Ë¤Ï 0 ¤òÊÖ¤·¡¢¼ºÇÔ»þ¤Ë¤Ï
411 .B REG_NOMATCH
412 ¤òÊÖ¤¹¡£
413 .\"O .SH ERRORS
414 .SH ¥¨¥é¡¼
415 .\"O The following errors can be returned by
416 .\"O .BR regcomp ():
417 .BR regcomp ()
418 ¤Ï°Ê²¼¤Î¥¨¥é¡¼¤òÊÖ¤¹¡£
419 .TP
420 .B REG_BADBR
421 .\"O Invalid use of back reference operator.
422 ̵¸ú¤Ê¸åÊý»²¾È¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£
423 .TP
424 .B REG_BADPAT
425 .\"O Invalid use of pattern operators such as group or list.
426 ¥°¥ë¡¼¥×¤ä¥ê¥¹¥È¤Ê¤É¤Î¡¢¥Ñ¥¿¡¼¥ó¥ª¥Ú¥ì¡¼¥¿¤Î̵¸ú¤Ê»ÈÍÑ¡£
427 .TP
428 .B REG_BADRPT
429 .\"O Invalid use of repetition operators such as using \(aq*\(aq
430 .\"O as the first character.
431 \(aq*\(aq ¤¬ºÇ½é¤Îʸ»ú¤È¤·¤Æ¤¯¤ë¤è¤¦¤Ê¡¢Ìµ¸ú¤Ê·«¤êÊÖ¤·¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£
432 .TP
433 .B REG_EBRACE
434 .\"O Un-matched brace interval operators.
435 ¥¤¥ó¥¿¡¼¥Ð¥ë¥ª¥Ú¥ì¡¼¥¿
436 .B {}
437 (brace interval operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£
438 .TP
439 .B REG_EBRACK
440 .\"O Un-matched bracket list operators.
441 ¥ê¥¹¥È¥ª¥Ú¥ì¡¼¥¿
442 .B []
443 (bracket list operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£
444 .TP
445 .B REG_ECOLLATE
446 .\"O Invalid collating element.
447 ¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element) ¤È¤·¤ÆÍ­¸ú¤Ç¤Ï¤Ê¤¤¡£
448
449 (ÌõÃí) ¾È¹ç½ç½ø¤ÎÍ×ÁÇ (collating element) ¤Ë¤Ä¤¤¤Æ¤Ï¡¢
450 .BR regex (7)
451 ¤ò»²¾È¡£
452 .TP
453 .B REG_ECTYPE
454 .\"O Unknown character class name.
455 ̤ÃΤΥ­¥ã¥é¥¯¥¿¥¯¥é¥¹Ì¾¡£
456 .TP
457 .B REG_EEND
458 .\"O Non specific error.
459 .\"O This is not defined by POSIX.2.
460 ̤ÄêµÁ¥¨¥é¡¼¡£¤³¤ì¤Ï POSIX.2 ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
461 .TP
462 .B REG_EESCAPE
463 .\"O Trailing backslash.
464 Àµµ¬É½¸½¤¬¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ç½ª¤Ã¤Æ¤¤¤ë¡£
465
466 (ÌõÃí) ÆüËܸì´Ä¶­¤Î¾ì¹ç¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤È¤Ê¤ë¤Ù¤­½ê¤¬±ßµ­¹æ¤Ç
467 ɽ¼¨¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¤¬¡¢¤³¤ì¤Ïñ¤Ëɽ¼¨¥Õ¥©¥ó¥È¤ÎÌäÂê¤Ç¡¢
468 ÆâÉôŪ¤Ë¤ÏƱ¤¸°ÕÌ£¤Ç¤¢¤ë¡£
469 .TP
470 .B REG_EPAREN
471 .\"O Un-matched parenthesis group operators.
472 ¥°¥ë¡¼¥×¥ª¥Ú¥ì¡¼¥¿
473 .B ()
474 (parenthesis group operators) ¤¬ÊĤ¸¤Æ¤¤¤Ê¤¤¡£
475 .TP
476 .B REG_ERANGE
477 .\"O Invalid use of the range operator, e.g., the ending point of the range
478 .\"O occurs prior to the starting point.
479 ̵¸ú¤ÊÈÏ°Ï¥ª¥Ú¥ì¡¼¥¿¤Î»ÈÍÑ¡£
480 Î㤨¤Ð¡¢ÈϰϤνªÎ»°ÌÃÖ¤¬³«»Ï°ÌÃÖ¤è¤ê¤âÁ°¤Ë¤¢¤ë¤è¤¦¤Ê¾ì¹ç¡£
481 .TP
482 .B REG_ESIZE
483 .\"O Compiled regular expression requires a pattern buffer larger than 64Kb.
484 .\"O This is not defined by POSIX.2.
485 Àµµ¬É½¸½¤Î¥³¥ó¥Ñ¥¤¥ë¤Ë¡¢64Kb °Ê¾å¤Î¥Ñ¥¿¡¼¥ó¥Ð¥Ã¥Õ¥¡¤¬É¬Íס£
486 ¤³¤ì¤Ï POSIX.2 ¤Ë¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
487 .TP
488 .B REG_ESPACE
489 .\"O The regex routines ran out of memory.
490 regex ¥ë¡¼¥Á¥ó¤¬¥á¥â¥ê¤ò»È¤¤¤Ï¤¿¤·¤Æ¤¤¤ë¡£
491 .TP
492 .B REG_ESUBREG
493 .\"O Invalid back reference to a subexpression.
494 ¥µ¥Ö¥¨¥¯¥¹¥×¥ì¥Ã¥·¥ç¥ó
495 .RB \e (...\e )
496 (subexpression) ¤Ø¤Î̵¸ú¤Ê¸åÊý»²¾È¡£
497 .\"O .SH "CONFORMING TO"
498 .SH ½àµò
499 POSIX.1-2001.
500 .\"O .SH "SEE ALSO"
501 .SH ´ØÏ¢¹àÌÜ
502 .BR grep (1),
503 .BR regex (7),
504 .\"O GNU regex manual
505 GNU regex ¥Þ¥Ë¥å¥¢¥ë