Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/re_exec.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/re_exec.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/re_exec.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/re_exec.html on line 8

re_exec()

Execute a regular expression

Synopsis:

#include <unix.h>

int re_exec( char *s );

Arguments:

s
A pointer to the string that you want to compare to the current regular expression. This string must end with a null byte and may include newline characters.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.


Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The re_exec() function compares the string pointed to by the string argument with the last regular expression passed to re_comp().

The re_comp() and re_exec() functions support simple regular expressions. The regular expressions of the form \{m\}, \{m,\}, or \{m,n\} aren't supported.


Note: For better portability, use regcomp(), regerror(), and regexec() instead of these functions.

Returns:

1
The string matches the last compiled regular expression.
0
The string doesn't match the last compiled regular expression.
-1
The compiled regular expression is invalid (indicating an internal error).

Classification:

Legacy Unix

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

re_comp(), regcomp(), regerror(), regexec()

grep in the Utilities Reference


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/r/re_exec.html on line 163

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/r/re_exec.html on line 163