Manage precompiled / predefined regular expressions. More...
#include <regex.h>
Go to the source code of this file.
Functions | |
regmatch_t * | mutt_prex_capture (enum Prex which, const char *str) |
Match a precompiled regex against a string. | |
void | mutt_prex_cleanup (void) |
Cleanup heap memory allocated by compiled regexes. | |
Manage precompiled / predefined regular expressions.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file prex.h.
enum Prex |
Predefined list of regular expressions.
Enumerator | |
---|---|
PREX_URL |
|
PREX_URL_QUERY_KEY_VAL |
|
PREX_RFC2047_ENCODED_WORD |
|
PREX_GNUTLS_CERT_HOST_HASH |
|
PREX_RFC5322_DATE_LAX |
|
PREX_IMAP_DATE |
|
PREX_MBOX_FROM |
|
PREX_MBOX_FROM_LAX |
|
PREX_ACCOUNT_CMD |
|
PREX_ALIAS_TAGS |
|
PREX_MAX |
Definition at line 32 of file prex.h.
enum PrexUrlSchemeMatch |
Definition at line 52 of file prex.h.
Regex Matches for PREX_URL_QUERY_KEY_VAL.
Enumerator | |
---|---|
PREX_URL_QUERY_KEY_VAL_MATCH_FULL |
|
PREX_URL_QUERY_KEY_VAL_MATCH_KEY |
|
PREX_URL_QUERY_KEY_VAL_MATCH_VAL |
|
PREX_URL_QUERY_KEY_VAL_MATCH_MAX |
Definition at line 81 of file prex.h.
Regex Matches for PREX_RFC2047_ENCODED_WORD.
Definition at line 94 of file prex.h.
Regex Matches for a TLS Certificate Hostname.
Definition at line 108 of file prex.h.
enum PrexRfc5322DateLax |
Regex Matches for a RFC5322 date, including obsolete comments in parentheses.
The reason we provide a regex for RFC5322 dates is that the regular parser is faster, while this one is more complete.
*_CFWS*
constants match ()
d comments with whitespace Definition at line 127 of file prex.h.
enum PrexImapDate |
Regex matches for an IMAP INTERNALDATE
Definition at line 160 of file prex.h.
enum PrexMboxFrom |
Regex matches for an mbox-style From line.
Definition at line 178 of file prex.h.
enum PrexMboxFromLax |
Regex matches for an mbox-style From line, lax mode.
Definition at line 197 of file prex.h.
enum PrexAccountCmd |
enum PrexAliasTags |
Regex matches for the tags: field of an alias command.
Definition at line 234 of file prex.h.
regmatch_t * mutt_prex_capture | ( | enum Prex | which, |
const char * | str | ||
) |
Match a precompiled regex against a string.
which | Which regex to return |
str | String to apply regex on |
ptr | Pointer to an array of matched captures |
NULL | Regex didn't match |
Definition at line 298 of file prex.c.
void mutt_prex_cleanup | ( | void | ) |
Cleanup heap memory allocated by compiled regexes.
Definition at line 339 of file prex.c.