MuPDF X.Y.Z

fitz/regexp.h

Index

typedef

struct

macro

function

Regexp

macro REG_ICASE

#define REG_ICASE 1

Flag to regcomp to enable case insensitive matching.

macro REG_NEWLINE

#define REG_NEWLINE 2

Flag to regcomp to enable matching ^ and $ on newlines.

macro REG_NOTBOL

#define REG_NOTBOL 4

Flag to regexec to indicate that the string does not start at the beginning of a line.

macro REG_RUNAWAY

#define REG_RUNAWAY 8

Flag to regexec to detect runaway backtracking.

macro REG_MAXSUB

#define REG_MAXSUB 16

Maximum number of sub expression that can be captured. If you redefine REG_MAXSUB, you must make sure both the calling code and the regexp.c compilation unit use the same value!

typedef fz_regex

typedef struct fz_regex fz_regex

Opaque datatype for a compiled regular expression program.

struct fz_regmatch

struct fz_regmatch {
        int nsub;
        struct {
                const char *sp;
                const char *ep;
        } sub[REG_MAXSUB];
}

Struct holding the results of a successful pattern match.

function fz_regcomp

struct fz_regex *
fz_regcomp (
        fz_context *ctx,
        const char *pattern,
        int cflags
)

Compile regular expression program.

function fz_regexec

int
fz_regexec (
        fz_context *ctx,
        struct fz_regex *prog,
        const char *string,
        struct fz_regmatch *sub,
        int eflags
)

Match regular expression program against a text string.

function fz_regfree

void
fz_regfree (
        fz_context *ctx,
        struct fz_regex *prog
)

Free regular exppression program.