|
ginnOS
The reference: libc, the libraries and the kernel
|
POSIX regular expressions, basic (BRE) and extended (ERE). More...
Go to the source code of this file.
Data Structures | |
| struct | re_pattern_buffer |
| a compiled expression (the layout is musl's) More... | |
| struct | regmatch_t |
| where a match (or a part of it) starts and ends; -1 when it did not match More... | |
Macros | |
| #define | REG_EXTENDED 1 |
| #define | REG_ICASE 2 |
| #define | REG_NEWLINE 4 |
| #define | REG_NOSUB 8 |
| #define | REG_NOTBOL 1 |
| #define | REG_NOTEOL 2 |
| #define | REG_OK 0 |
| #define | REG_NOMATCH 1 |
| #define | REG_BADPAT 2 |
| #define | REG_ECOLLATE 3 |
| #define | REG_ECTYPE 4 |
| #define | REG_EESCAPE 5 |
| #define | REG_ESUBREG 6 |
| #define | REG_EBRACK 7 |
| #define | REG_EPAREN 8 |
| #define | REG_EBRACE 9 |
| #define | REG_BADBR 10 |
| #define | REG_ERANGE 11 |
| #define | REG_ESPACE 12 |
| #define | REG_BADRPT 13 |
| #define | REG_ENOSYS -1 |
Typedefs | |
| typedef ssize_t | regoff_t |
| typedef struct re_pattern_buffer | regex_t |
| a compiled expression (the layout is musl's) | |
Functions | |
| int | regcomp (regex_t *restrict preg, const char *restrict pattern, int cflags) |
| compile pattern into preg: REG_OK, or an error for regerror | |
| int | regexec (const regex_t *restrict preg, const char *restrict text, size_t nmatch, regmatch_t *restrict pmatch, int eflags) |
| match text against preg: REG_OK or REG_NOMATCH. | |
| void | regfree (regex_t *preg) |
| size_t | regerror (int error, const regex_t *restrict preg, char *restrict buffer, size_t size) |
| the message for an error into buffer (size bytes, cut if it is longer). | |
POSIX regular expressions, basic (BRE) and extended (ERE).
The matcher is musl's (from TRE): see src/libc/src/regex/README.md.
| #define REG_EXTENDED 1 |
| #define REG_ICASE 2 |
| #define REG_NEWLINE 4 |
| #define REG_NOSUB 8 |
| #define REG_NOTBOL 1 |
| #define REG_NOTEOL 2 |
| #define REG_OK 0 |
| #define REG_NOMATCH 1 |
| #define REG_BADPAT 2 |
| #define REG_ECOLLATE 3 |
| #define REG_ECTYPE 4 |
| #define REG_EESCAPE 5 |
| #define REG_ESUBREG 6 |
| #define REG_EBRACK 7 |
| #define REG_EPAREN 8 |
| #define REG_EBRACE 9 |
| #define REG_BADBR 10 |
| #define REG_ERANGE 11 |
| #define REG_ESPACE 12 |
| #define REG_BADRPT 13 |
| #define REG_ENOSYS -1 |
| typedef struct re_pattern_buffer regex_t |
a compiled expression (the layout is musl's)
| int regcomp | ( | regex_t *restrict | preg, |
| const char *restrict | pattern, | ||
| int | cflags ) |
compile pattern into preg: REG_OK, or an error for regerror
| int regexec | ( | const regex_t *restrict | preg, |
| const char *restrict | text, | ||
| size_t | nmatch, | ||
| regmatch_t *restrict | pmatch, | ||
| int | eflags ) |
match text against preg: REG_OK or REG_NOMATCH.
pmatch gets where the match and the first nmatch - 1 parts are.
| void regfree | ( | regex_t * | preg | ) |