This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use $^O
[perl5.git] / regexp.h
1 /*    regexp.h
2  */
3
4 /*
5  * Definitions etc. for regexp(3) routines.
6  *
7  * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
8  * not the System V one.
9  */
10
11
12 typedef struct regexp {
13         char **startp;
14         char **endp;
15         SV *regstart;           /* Internal use only. */
16         char *regstclass;
17         SV *regmust;            /* Internal use only. */
18         I32 regback;            /* Can regmust locate first try? */
19         I32 minlen;             /* mininum possible length of $& */
20         I32 prelen;             /* length of precomp */
21         U32 nparens;            /* number of parentheses */
22         U32 lastparen;          /* last paren matched */
23         char *precomp;          /* pre-compilation regular expression */
24         char *subbase;          /* saved string so \digit works forever */
25         char *subbeg;           /* same, but not responsible for allocation */
26         char *subend;           /* end of subbase */
27         U16 naughty;            /* how exponential is this pattern? */
28         char reganch;           /* Internal use only. */
29         char do_folding;        /* do case-insensitive match? */
30         char program[1];        /* Unwarranted chumminess with compiler. */
31 } regexp;
32
33 #define ROPT_ANCH 1
34 #define ROPT_SKIP 2
35 #define ROPT_IMPLICIT 4