Lazy RE
|
Lazy RE header file. More...
#include <regex.h>
#include <stdbool.h>
Go to the source code of this file.
Classes | |
struct | RegexMatch |
Represents regex match. More... | |
Macros | |
#define | REGEX_MAX_GROUP 10 |
Max number of groups in match. More... | |
Functions | |
void | Regex_compile (regex_t *regex, const char *pattern, const int cflags) |
Compiles regex. More... | |
void | Regex_free (regex_t *regex) |
Frees memory allocated for regex. More... | |
bool | Regex_test (const char *pattern, const char *string) |
Test whether pattern presents in a string. More... | |
RegexMatch * | Regex_search (const char *pattern, const char *string, const int eflags) |
Search first occurrence of a pattern in a string. More... | |
RegexMatch * | Regex_compiledSearch (regex_t *regex, const char *string, const int eflags) |
Search a first occurrence of a regex in a string. More... | |
RegexMatch * | Regex_searchNext () |
Performs next search from cache of the last successful one. More... | |
Lazy RE header file.
#define REGEX_MAX_GROUP 10 |
Max number of groups in match.
void Regex_compile | ( | regex_t * | regex, |
const char * | pattern, | ||
const int | cflags | ||
) |
Compiles regex.
Regex cflags reference http://www.gnu.org/software/libc/manual/html_node/Flags-for-POSIX-Regexps.html#Flags-for-POSIX-Regexps
regex | Pointer to a struct with regex. |
pattern | String containing regex. |
cflags | Regex flags with which regex is created. |
RegexMatch* Regex_compiledSearch | ( | regex_t * | regex, |
const char * | string, | ||
const int | eflags | ||
) |
Search a first occurrence of a regex in a string.
Regex eflags reference http://www.gnu.org/software/libc/manual/html_node/Matching-POSIX-Regexps.html#Matching-POSIX-Regexps
regex | Regex which will be used to match. |
string | String against which to perform match. |
eflags | Regex flags with which to match. |
void Regex_free | ( | regex_t * | regex | ) |
Frees memory allocated for regex.
regex | Regex struct. |
RegexMatch* Regex_search | ( | const char * | pattern, |
const char * | string, | ||
const int | eflags | ||
) |
Search first occurrence of a pattern in a string.
Regex eflags reference http://www.gnu.org/software/libc/manual/html_node/Matching-POSIX-Regexps.html#Matching-POSIX-Regexps
regex | Pattern which will be used to match. |
string | String against which to perform match. |
eflags | Regex flags with which to match. |
RegexMatch* Regex_searchNext | ( | ) |
Performs next search from cache of the last successful one.
bool Regex_test | ( | const char * | pattern, |
const char * | string | ||
) |
Test whether pattern presents in a string.
regex | Pattern which will be used to match. |
string | String against which to perform match. |
true | If pattern is found. |
false | otherwise. |