logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

regex.h.0p (4858B)


  1. '\" et
  2. .TH regex.h "0P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. regex.h
  12. \(em regular expression matching types
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <regex.h>
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR <regex.h>
  21. header shall define the structures and symbolic constants used by the
  22. \fIregcomp\fR(),
  23. \fIregexec\fR(),
  24. \fIregerror\fR(),
  25. and
  26. \fIregfree\fR()
  27. functions.
  28. .P
  29. The
  30. .IR <regex.h>
  31. header shall define the
  32. .BR regex_t
  33. structure type, which shall include at least the following member:
  34. .sp
  35. .RS 4
  36. .nf
  37. size_t re_nsub \fRNumber of parenthesized subexpressions.\fR
  38. .fi
  39. .P
  40. .RE
  41. .P
  42. The
  43. .IR <regex.h>
  44. header shall define the
  45. .BR size_t
  46. type as described in
  47. .IR <sys/types.h> .
  48. .P
  49. The
  50. .IR <regex.h>
  51. header shall define the
  52. .BR regoff_t
  53. type as a signed integer type that can hold
  54. the largest value that can be stored in either a
  55. .BR ptrdiff_t
  56. type or a
  57. .BR ssize_t
  58. type.
  59. .P
  60. The
  61. .IR <regex.h>
  62. header shall define the
  63. .BR regmatch_t
  64. structure type, which shall include at least the following members:
  65. .sp
  66. .RS 4
  67. .nf
  68. regoff_t rm_so \fRByte offset from start of string\fR
  69. \fRto start of substring.\fR
  70. regoff_t rm_eo \fRByte offset from start of string of the\fR
  71. \fRfirst character after the end of substring.\fR
  72. .fi
  73. .P
  74. .RE
  75. .P
  76. The
  77. .IR <regex.h>
  78. header shall define the following symbolic constants for the
  79. .IR cflags
  80. parameter to the
  81. \fIregcomp\fR()
  82. function:
  83. .IP REG_EXTENDED 14
  84. Use Extended Regular Expressions.
  85. .IP REG_ICASE 14
  86. Ignore case in match.
  87. .IP REG_NOSUB 14
  88. Report only success or fail in
  89. \fIregexec\fR().
  90. .IP REG_NEWLINE 14
  91. Change the handling of
  92. <newline>.
  93. .P
  94. The
  95. .IR <regex.h>
  96. header shall define the following symbolic constants for the
  97. .IR eflags
  98. parameter to the
  99. \fIregexec\fR()
  100. function:
  101. .IP REG_NOTBOL 14
  102. The
  103. <circumflex>
  104. character (\c
  105. .BR '\(ha' ),
  106. when taken as a special character, does not match the beginning of
  107. .IR string .
  108. .IP REG_NOTEOL 14
  109. The
  110. <dollar-sign>
  111. (\c
  112. .BR '$' ),
  113. when taken as a special character, does not match the end of
  114. .IR string .
  115. .P
  116. The
  117. .IR <regex.h>
  118. header shall define the following symbolic constants as error
  119. return values:
  120. .IP REG_NOMATCH 14
  121. \fIregexec\fR()
  122. failed to match.
  123. .IP REG_BADPAT 14
  124. Invalid regular expression.
  125. .IP REG_ECOLLATE 14
  126. Invalid collating element referenced.
  127. .IP REG_ECTYPE 14
  128. Invalid character class type referenced.
  129. .IP REG_EESCAPE 14
  130. Trailing
  131. <backslash>
  132. character in pattern.
  133. .IP REG_ESUBREG 14
  134. Number in \e\fIdigit\fP invalid or in error.
  135. .IP REG_EBRACK 14
  136. .BR \(dq[]\(dq
  137. imbalance.
  138. .IP REG_EPAREN 14
  139. .BR \(dq\e(\e)\(dq
  140. or
  141. .BR \(dq()\(dq
  142. imbalance.
  143. .IP REG_EBRACE 14
  144. .BR \(dq\e{\e}\(dq
  145. imbalance.
  146. .IP REG_BADBR 14
  147. Content of
  148. .BR \(dq\e{\e}\(dq
  149. invalid: not a number, number too large, more than two numbers, first
  150. larger than second.
  151. .IP REG_ERANGE 14
  152. Invalid endpoint in range expression.
  153. .IP REG_ESPACE 14
  154. Out of memory.
  155. .IP REG_BADRPT 14
  156. .BR '?' ,
  157. .BR '*' ,
  158. or
  159. .BR '+'
  160. not preceded by valid regular expression.
  161. .P
  162. The following shall be declared as functions and may also be defined
  163. as macros. Function prototypes shall be provided.
  164. .sp
  165. .RS 4
  166. .nf
  167. int regcomp(regex_t *restrict, const char *restrict, int);
  168. size_t regerror(int, const regex_t *restrict, char *restrict, size_t);
  169. int regexec(const regex_t *restrict, const char *restrict, size_t,
  170. regmatch_t [restrict], int);
  171. void regfree(regex_t *);
  172. .fi
  173. .P
  174. .RE
  175. .P
  176. The implementation may define additional macros or constants using
  177. names beginning with REG_.
  178. .LP
  179. .IR "The following sections are informative."
  180. .SH "APPLICATION USAGE"
  181. None.
  182. .SH RATIONALE
  183. None.
  184. .SH "FUTURE DIRECTIONS"
  185. None.
  186. .SH "SEE ALSO"
  187. .IR "\fB<sys_types.h>\fP"
  188. .P
  189. The System Interfaces volume of POSIX.1\(hy2017,
  190. .IR "\fIregcomp\fR\^(\|)"
  191. .\"
  192. .SH COPYRIGHT
  193. Portions of this text are reprinted and reproduced in electronic form
  194. from IEEE Std 1003.1-2017, Standard for Information Technology
  195. -- Portable Operating System Interface (POSIX), The Open Group Base
  196. Specifications Issue 7, 2018 Edition,
  197. Copyright (C) 2018 by the Institute of
  198. Electrical and Electronics Engineers, Inc and The Open Group.
  199. In the event of any discrepancy between this version and the original IEEE and
  200. The Open Group Standard, the original IEEE and The Open Group Standard
  201. is the referee document. The original Standard can be obtained online at
  202. http://www.opengroup.org/unix/online.html .
  203. .PP
  204. Any typographical or formatting errors that appear
  205. in this page are most likely
  206. to have been introduced during the conversion of the source files to
  207. man page format. To report such errors, see
  208. https://www.kernel.org/doc/man-pages/reporting_bugs.html .