AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
REGEXP (5) REGEXP (5) NAME regexp - regular expression compile and match routines SYNOPSIS #define INIT #define GETC( ) #define PEEKC( ) #define UNGETC(c) #define RETURN(pointer) #define ERROR(val) #include char *compile(instring, expbuf, endbuf, eof) char *instring, *expbuf, *endbuf; int step(string, expbuf) char •string, *expbuf; DESCRIPTION This page describes general purpose regular expression matching routines in the form of ed(l), defined in /usr/include/ regexp.h. Programs such as ed(l), sed(l), grep(l), expr(l), etc., which perform regular expression matching, use this source file. In this way, only this file need be changed to maintain regular expression compatibility. The interface to this file is unpleasantly complex. Programs that include this file must have the following five macros declared before the "#include " statement. These macros are used by the compile routine. GETC( ) Return the value of the next character in the regular expression pattern. Successive calls to GETC( ) should return successive characters of the regular expression. PEEKC( ) Return the next character in the regular expression. Successive calls to PEEKC( ) should return the same character (which should also be the next character returned by GETC( )). UNGETC(c) Cause the argument c to be returned by the next call to GETC( ) (and PEEKC( )). No more that one character of pushback is ever needed and this character is guaranteed to be the last character read by GETC( ). The value of the macro UNGETC( c) is always ignored. RETURN( pointer) This macro is used on normal exit of the compile routine. The value of the argument pointer is a pointer to the character after the last character of the compiled regular expression. This is useful to programs which have memory allocation to manage. - 1 -
- Page 1104 and 1105: y . /
- Page 1107: PROFILE ( 4) PROFILE ( 4) NAME prof
- Page 1110 and 1111: RELOC (4) RELOC ( 4) R_ABS The refe
- Page 1112 and 1113: (�
- Page 1114 and 1115: SCCSFILE ( 4) SCCSFILE ( 4) time of
- Page 1116 and 1117: (�
- Page 1119 and 1120: SHLill ( 4) (AT&T UNIX PC only ) SH
- Page 1121 and 1122: SYMS ( 4) SYMS ( 4) NAME syms - com
- Page 1123 and 1124: UA ( 4) (AT&T UNIX PC only ) UA ( 4
- Page 1125 and 1126: UA ( 4) Rename (AT&T UNIX PC only )
- Page 1127 and 1128: UA ( 4) (AT&T UNIX PC only ) UA (4)
- Page 1129 and 1130: UA ( 4) (AT&T UNIX PC only ) UA ( 4
- Page 1131 and 1132: UTMP ( 4) UTMP ( 4) NAME utmp, wtmp
- Page 1133: INTRO ( 5) NAME intro - introductio
- Page 1136 and 1137: ,!)
- Page 1139: .� EQNCHAR (5) EQNCHAR (5) NAME e
- Page 1143 and 1144: GREEK (5) GREEK (5) NAME greek - gr
- Page 1145 and 1146: MAN(5) MAN ( 5) NAME man - macros f
- Page 1147 and 1148: MAN (5) MAN (5) . � FILES The mac
- Page 1149 and 1150: MM (5) MM ( 5 ) NAME mm - the MM ma
- Page 1151 and 1152: MODEMCAP ( 5) ( AT&T UNIX PC Only )
- Page 1153: � MPTX ( 5 ) MPTX ( 5 ) NAME mptx
- Page 1157 and 1158: REGEXP (5) REGEXP (5) The first par
- Page 1159 and 1160: STAT ( 5) STAT (S) NAME stat - data
- Page 1161: TERM( 5) TERM (5) NAME term - conve
- Page 1164 and 1165: TERMCAP (5) TERMCAP (5) dl str (P*)
- Page 1166 and 1167: TERMCAP (5) TERMCAP (5) Numeric cap
- Page 1168 and 1169: TERMCAP (5) TERMCAP (Ii) below). Th
- Page 1170 and 1171: TERMCAP (5) TERMCAP (5) If the term
- Page 1172 and 1173: TERMCAP (5) TERMCAP (5) attributes,
- Page 1174 and 1175: :�
- Page 1176: VARARGS ( 5) VARARGS ( 5) int argno
REGEXP (5) REGEXP (5)<br />
NAME<br />
regexp - regular expression compile and match routines<br />
SYNOPSIS<br />
#define INIT <br />
#define GETC( ) <br />
#define PEEKC( ) <br />
#define UNGETC(c) <br />
#define RETURN(pointer) <br />
#define ERROR(val) <br />
#include <br />
char *compile(instring, expbuf, endbuf, eof)<br />
char *instring, *expbuf, *endbuf;<br />
int step(string, expbuf)<br />
char •string, *expbuf;<br />
DESCRIPTION<br />
This page describes general purpose regular expression matching<br />
routines in the form of ed(l), defined in /usr/include/ regexp.h.<br />
Programs such as ed(l), sed(l), grep(l), expr(l), etc., which perform<br />
regular expression matching, use this source file. In this way,<br />
only this file need be changed to maintain regular expression compatibility.<br />
The interface to this file is unpleasantly complex. Programs that<br />
include this file must have the following five macros declared<br />
before the "#include " statement. These macros are<br />
used by the compile routine.<br />
GETC( ) Return the value of the next character in<br />
the regular expression pattern. Successive<br />
calls to GETC( ) should return successive<br />
characters of the regular expression.<br />
PEEKC( )<br />
Return the next character in the regular<br />
expression. Successive calls to PEEKC( )<br />
should return the same character (which<br />
should also be the next character returned<br />
by GETC( )).<br />
UNGETC(c) Cause the argument c to be returned by<br />
the next call to GETC( ) (and PEEKC( )).<br />
No more that one character of pushback is<br />
ever needed and this character is<br />
guaranteed to be the last character read by<br />
GETC( ). The value of the macro<br />
UNGETC( c) is always ignored.<br />
RETURN( pointer) This macro is used on normal exit of the<br />
compile routine. The value of the argument<br />
pointer is a pointer to the character<br />
after the last character of the compiled regular<br />
expression. This is useful to programs<br />
which have memory allocation to manage.<br />
- 1 -