BSD 4_4 development
[unix-history] / usr / share / man / cat3 / re_exec.0
RE_COMP(3) BSD Programmer's Manual RE_COMP(3)
N\bNA\bAM\bME\bE
r\bre\be_\b_c\bco\bom\bmp\bp, r\bre\be_\b_e\bex\bxe\bec\bc - regular expression handler
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<u\bun\bni\bis\bst\btd\bd.\b.h\bh>\b>
_\bc_\bh_\ba_\br _\b*
r\bre\be_\b_c\bco\bom\bmp\bp(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bs);
_\bi_\bn_\bt
r\bre\be_\b_e\bex\bxe\bec\bc(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bs);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
This interface is made obsolete by regex(3).
The r\bre\be_\b_c\bco\bom\bmp\bp() function compiles a string into an internal form suitable
for pattern matching. The r\bre\be_\b_e\bex\bxe\bec\bc() function checks the argument string
against the last string passed to r\bre\be_\b_c\bco\bom\bmp\bp().
The r\bre\be_\b_c\bco\bom\bmp\bp() function returns 0 if the string _\bs was compiled successful-
ly; otherwise a string containing an error message is returned. If
r\bre\be_\b_c\bco\bom\bmp\bp() is passed 0 or a null string, it returns without changing the
currently compiled regular expression.
The r\bre\be_\b_e\bex\bxe\bec\bc() function returns 1 if the string _\bs matches the last com-
piled regular expression, 0 if the string _\bs failed to match the last com-
piled regular expression, and -1 if the compiled regular expression was
invalid (indicating an internal error).
The strings passed to both r\bre\be_\b_c\bco\bom\bmp\bp() and r\bre\be_\b_e\bex\bxe\bec\bc() may have trailing or
embedded newline characters; they are terminated by NULs. The regular ex-
pressions recognized are described in the manual entry for ed(1), given
the above difference.
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
The r\bre\be_\b_e\bex\bxe\bec\bc() function returns -1 for an internal error.
The r\bre\be_\b_c\bco\bom\bmp\bp() function returns one of the following strings if an error
occurs:
No previous regular expression,
Regular expression too long,
unmatched \(,
missing ],
too many \(\) pairs,
unmatched \).
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
ed(1), ex(1), egrep(1), fgrep(1), grep(1), regex(3)
H\bHI\bIS\bST\bTO\bOR\bRY\bY
The r\bre\be_\b_c\bco\bom\bmp\bp() and r\bre\be_\b_e\bex\bxe\bec\bc() functions appeared in 4.0BSD.
4.4BSD June 4, 1993 1