NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
prex.c File Reference
#include "config.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include "prex.h"
#include "logging.h"
#include "memory.h"
+ Include dependency graph for prex.c:

Go to the source code of this file.

Data Structures

struct  PrexStorage
 A predefined / precompiled regex. More...


#define PREX_MONTH   "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"
#define PREX_DOW   "(Mon|Tue|Wed|Thu|Fri|Sat|Sun)"
#define PREX_TIME   "([[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2})"
#define PREX_YEAR   "([[:digit:]]{4})"
#define UNR_PCTENC_SUBDEL   "][[:alnum:]._~%!$&'()*+,;="
#define PATH   ":@/ "
#define QUERY_PART   "^&="
#define FWS   " *"
#define C   "(\\(.*\\))?"
#define CFWS   FWS C FWS


static struct PrexStorageprex (enum Prex which)
 Compile on demand and get data for a predefined regex. More...

Detailed Description

Manage precompiled / predefined regular expressions

  • Pietro Cerutti

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

Definition in file prex.c.

Macro Definition Documentation


#define PREX_MONTH   "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"

Definition at line 81 of file prex.c.


#define PREX_DOW   "(Mon|Tue|Wed|Thu|Fri|Sat|Sun)"

Definition at line 82 of file prex.c.


"([Mm][Oo][Nn]|[Tt][Uu][Ee]|[Ww][Ee][Dd]|[Tt][Hh][Uu]|[Ff][Rr][Ii]|" \

Definition at line 83 of file prex.c.


#define PREX_TIME   "([[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2})"

Definition at line 86 of file prex.c.


#define PREX_YEAR   "([[:digit:]]{4})"

Definition at line 87 of file prex.c.


#define UNR_PCTENC_SUBDEL   "][[:alnum:]._~%!$&'()*+,;="


#define PATH   ":@/ "


#define QUERY_PART   "^&="


#define FWS   " *"

◆ C

#define C   "(\\(.*\\))?"


#define CFWS   FWS C FWS

Function Documentation

◆ prex()

static struct PrexStorage* prex ( enum Prex  which)

Compile on demand and get data for a predefined regex.

whichWhich regex to get
Return values
ptrPointer to a PrexStorage struct
Returned pointer is guaranteed not to be NULL. The function asserts on error.

Definition at line 97 of file prex.c.

+ Here is the call graph for this function: