char *re_comp(char *s);re_exec(char *s);
The re_exec function compares the string pointed to by the string argument with the last regular expression passed to re_comp.
If re_comp is called with a null pointer argument, the current regular expression remains unchanged. Strings passed to both re_comp and re_exec must b terminated by a NULL byte, and may include newline characters.
The strings passed to both re_comp and re_exec may have trailing or embedded NEWLINE characters; they are terminated by null characters. The regular expressions recognized are described in the manual page entry for ed(1), given the above difference.
No previous regular expression Regular expression too long unmatched \( missing ] too many \(\) pairs unmatched \)
Upon successful completion, re_exec returns 1 if string matches the last compiled regular expression. Otherwise, re_exec returns 0 if string fails to match the last compiled regular expression, and -1 if the compiled regular expression is invalid (indicating an internal error). characters; they are terminated by null characters. The regular expressions recognized are described in the manual page entry for ed(1), given the above difference.