HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)

r
regcmp(3X) regcmp(3X)
(TO BE OBSOLETED)
char *cursor, *newcursor, *ptr;
...
newcursor = regex((ptr = regcmp("ˆ\n", 0)), cursor);
free(ptr);
Match through the string Testing3 and return the address of the character after the last matched char-
acter (cursor+11). The string Testing3 will be copied to the character array
ret0.
char ret0[9];
char newcursor, *name;
...
name = regcmp("([A -Za-z][A-Za-z0-9_]{0,7})$0", 0);
newcursor = regex(name, "123Testing321", ret0);
WARNINGS
User programs that use regcmp() might run out of memory if
regcmp() is called iteratively without
freeing vectors that are no longer required.
Obsolescent Interfaces
regcmp() and regex() are to be obsoleted at a future date.
SEE ALSO
ed(1), malloc(3C), regcomp(3C).
Section 3788 Hewlett-Packard Company 2 HP-UX 11i Version 1: September 2005