HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
r
regexp(3X) regexp(3X)
advance() breaks out of the loop that backs up and returns zero. This is used by ed(1) and sed(1) for
substitutions done globally (not just the first occurrence, but the whole line) so, for example, expressions
such as
s/y*//g do not loop forever.
The additional external variables
sed and nbra are used for special purposes.
EXTERNAL INFLUENCES
Environment Variables
LC_COLLATE determines the collating sequence used in compiling and executing regular expressions.
The
LC_CTYPE category determines the interpretation of text as single and/or multi-byte characters, and
the characters matched by character class expressions in regular expressions.
International Code Set Support
Single- and multi-byte character code sets are supported.
EXAMPLES
The following is an example of how the regular expression macros and calls look from grep(1):
#define INIT register char *sp = instring;
#define GETC() (*sp++)
#define PEEKC() (*sp)
#define UNGETC(c) (--sp)
#define RETURN(c) return;
#define ERROR(c) regerr()
#include <regexp.h>
...
(void) compile(*argv, expbuf, &expbuf[ESIZE], ’\0’);
...
if (step(linebuf, expbuf))
succeed();
SEE ALSO
grep(1), regcomp(3C), setlocale(3C), regexp(5).
STANDARDS CONFORMANCE
advance(): AES, SVID2, SVID3, XPG2, XPG3, XPG4
compile(): AES, SVID2, SVID3, XPG2, XPG3, XPG4
loc1: AES, SVID2, SVID3, XPG2, XPG3, XPG4
loc2: AES, SVID2, SVID3, XPG2, XPG3, XPG4
locs: AES, SVID2, SVID3, XPG2, XPG3, XPG4
step(): AES, SVID2, SVID3, XPG2, XPG3, XPG4
Section 3−−874 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: September 2004