aboutsummaryrefslogtreecommitdiff
path: root/src/njs_regexp_pattern.h
blob: 8befc6067b83f22e7093744d1b7de8ce493a3c29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) NGINX, Inc.
 */

#ifndef _NJS_REGEXP_PATTERN_H_INCLUDED_
#define _NJS_REGEXP_PATTERN_H_INCLUDED_


typedef enum {
    NJS_REGEXP_BYTE = 0,
    NJS_REGEXP_UTF8,
} njs_regexp_utf8_t;


typedef struct njs_regexp_group_s  njs_regexp_group_t;


struct njs_regexp_pattern_s {
    njs_regex_t           regex[2];

    /* A zero-terminated C string. */
    u_char                *source;

    uint16_t              ncaptures;
    uint16_t              ngroups;

    uint8_t               global;       /* 1 bit */
    uint8_t               ignore_case;  /* 1 bit */
    uint8_t               multiline;    /* 1 bit */
    uint8_t               sticky;       /* 1 bit */

    njs_regexp_group_t    *groups;
};


#endif /* _NJS_REGEXP_PATTERN_H_INCLUDED_ */