24#ifndef MUTT_MUTT_REGEX3_H
25#define MUTT_MUTT_REGEX3_H
50#define REG_COMP(preg, regex, cflags) regcomp(preg, regex, REG_WORDS | REG_EXTENDED | (cflags))
79 return match->rm_eo - match->rm_so;
#define STAILQ_HEAD(name, type)
int mutt_replacelist_remove(struct ReplaceList *rl, const char *pat)
Remove a pattern from a list.
struct Regex * mutt_regex_new(const char *str, uint32_t flags, struct Buffer *err)
Create an Regex from a string.
struct RegexNode * mutt_regexlist_new(void)
Create a new RegexList.
struct Regex * mutt_regex_compile(const char *str, uint16_t flags)
Create an Regex from a string.
void mutt_regexlist_free(struct RegexList *rl)
Free a RegexList object.
int mutt_regexlist_add(struct RegexList *rl, const char *str, uint16_t flags, struct Buffer *err)
Compile a regex string and add it to a list.
void mutt_replacelist_free(struct ReplaceList *rl)
Free a ReplaceList object.
int mutt_regexlist_remove(struct RegexList *rl, const char *str)
Remove a Regex from a list.
bool mutt_replacelist_match(struct ReplaceList *rl, char *buf, size_t buflen, const char *str)
Does a string match a pattern?
static size_t mutt_regmatch_len(const regmatch_t *match)
Return the length of a match.
char * mutt_replacelist_apply(struct ReplaceList *rl, const char *str)
Apply replacements to a buffer.
struct Replace * mutt_replacelist_new(void)
Create a new ReplaceList.
int mutt_replacelist_add(struct ReplaceList *rl, const char *pat, const char *templ, struct Buffer *err)
Add a pattern and a template to a list.
static regoff_t mutt_regmatch_end(const regmatch_t *match)
Return the end of a match.
bool mutt_regexlist_match(struct RegexList *rl, const char *str)
Does a string match any Regex in the list?
bool mutt_regex_capture(const struct Regex *regex, const char *str, size_t num, regmatch_t matches[])
Match a regex against a string, with provided options.
void mutt_regex_free(struct Regex **ptr)
Free a Regex object.
static regoff_t mutt_regmatch_start(const regmatch_t *match)
Return the start of a match.
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
String manipulation buffer.
List of regular expressions.
STAILQ_ENTRY(RegexNode) entries
Linked list.
struct Regex * regex
Regex containing a regular expression.
Cached regular expression.
char * pattern
printable version
regex_t * regex
compiled expression
List of regular expressions.
char * templ
Template to match.
size_t nmatch
Match the 'nth' occurrence (0 means the whole expression)
STAILQ_ENTRY(Replace) entries
Linked list.
struct Regex * regex
Regex containing a regular expression.