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 | [imaps://user:pass@example.com/INBOX?foo=bar] |
| PREX_URL_QUERY_KEY_VAL | https://example.com/?[q=foo] |
| PREX_RFC2047_ENCODED_WORD | [=?utf-8?Q?=E8=81=AA=E6=98=8E=E7=9A=84?=] |
| PREX_GNUTLS_CERT_HOST_HASH |
|
| PREX_RFC5322_DATE_LAX | [Mon, (Comment) 16 Mar 2020 15:09:35 -0700] |
| PREX_IMAP_DATE | [16-MAR-2020 15:09:35 -0700] |
| PREX_MBOX_FROM | [From god@heaven.af.mil Sat Jan 3 01:05:34 1996] |
| PREX_MBOX_FROM_LAX | [From god@heaven.af.mil Sat Jan 3 01:05:34 1996] |
| PREX_ACCOUNT_CMD | key: value |
| PREX_ALIAS_TAGS | tags:a,b,c |
| 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 | [key=val] |
| PREX_URL_QUERY_KEY_VAL_MATCH_KEY | [key]=val |
| PREX_URL_QUERY_KEY_VAL_MATCH_VAL | key=[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.
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 233 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 301 of file prex.c.
| void mutt_prex_cleanup | ( | void | ) |
Cleanup heap memory allocated by compiled regexes.
Definition at line 342 of file prex.c.