2 * vim:ts=4:sw=4:expandtab
4 * i3 - an improved dynamic tiling window manager
5 * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
7 * regex.c: Interface to libPCRE (perl compatible regular expressions).
14 * Creates a new 'regex' struct containing the given pattern and a PCRE
15 * compiled regular expression. Also, calls pcre_study because this regex will
16 * most likely be used often (like for every new window and on every relevant
17 * property change of existing windows).
19 * Returns NULL if the pattern could not be compiled into a regular expression
20 * (and ELOGs an appropriate error message).
23 struct regex *regex_new(const char *pattern);
26 * Frees the given regular expression. It must not be used afterwards!
29 void regex_free(struct regex *regex);
32 * Checks if the given regular expression matches the given input and returns
33 * true if it does. In either case, it logs the outcome using LOG(), so it will
34 * be visible without debug logging.
37 bool regex_matches(struct regex *regex, const char *input);