34 const char **output,
size_t *output_len,
37 if (regex_len == 0 || *regex !=
'^')
40 for (ptr=*output; ptr<regex+regex_len; ptr++) {
41 if (*ptr ==
'.' || *ptr ==
'[' || *ptr ==
'(' || *ptr ==
'{' || *ptr ==
'\\' || *ptr ==
'+' || *ptr ==
'$') {
42 *output_len = ptr - *output;
43 return *output_len > 0;
45 else if (*ptr ==
'*' || *ptr ==
'?' || *ptr ==
'|') {
46 if ((ptr - *output) == 0)
48 *output_len = (ptr - *output) - 1;
49 return *output_len > 0;
52 *output_len = ptr - *output;
53 return *output_len > 0;
A dynamic, resizable and reference counted memory buffer.
Compatibility Macros for C/C++.
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.