Provides utility functions for regular expressions. More...
#include <Regex.h>
Static Public Member Functions | |
static bool | extract_prefix (const char *regex, size_t regex_len, const char **output, size_t *output_len, DynamicBuffer &buf) |
Extracts a fixed prefix from regular expression. More... | |
|
static |
Extracts a fixed prefix from regular expression.
This function extracts a fixed prefix from the regular expression defined by regex
and regex_len
. A candidate string which maches the regex implies that the string begins with the fixed prefix. A fixed prefix can only be extacted from a regular expression that begins with the '^' character and is followed by some number of non-qualified, non-meta characters.
regex | Pointer to regular expression |
regex_len | Length of regular expression |
output | Address of output pointer to beginning of prefix |
output_len | Address of output length to hold length of prefix |
buf | Buffer to hold prefix if expansion was required |