54 size_t nmatch, regmatch_t pmatch[])
const;
56 virtual void seterr(
int _errnum);
59 int &match_start,
int &match_end, WVREGEX_REGS_DECL)
const
61 regmatch_t pmatch[21];
64#define __WVRE_COUNT_REGS(n) \
65 if ( &__WVRE_REG(n) != &__wvre_null_reg) ++nmatch
67 __WVRE_COUNT_REGS( 0); __WVRE_COUNT_REGS( 1);
68 __WVRE_COUNT_REGS( 2); __WVRE_COUNT_REGS( 3);
69 __WVRE_COUNT_REGS( 4); __WVRE_COUNT_REGS( 5);
70 __WVRE_COUNT_REGS( 6); __WVRE_COUNT_REGS( 7);
71 __WVRE_COUNT_REGS( 8); __WVRE_COUNT_REGS( 9);
72 __WVRE_COUNT_REGS(10); __WVRE_COUNT_REGS(11);
73 __WVRE_COUNT_REGS(12); __WVRE_COUNT_REGS(13);
74 __WVRE_COUNT_REGS(14); __WVRE_COUNT_REGS(15);
75 __WVRE_COUNT_REGS(16); __WVRE_COUNT_REGS(17);
76 __WVRE_COUNT_REGS(18); __WVRE_COUNT_REGS(19);
78 if (!match(
string, eflags, nmatch, pmatch))
return false;
80 match_start = pmatch[0].rm_so;
81 match_end = pmatch[0].rm_eo;
83#define __WVRE_STORE_REGS(n) \
84 if (&__WVRE_REG(n) != &__wvre_null_reg \
85 && pmatch[n+1].rm_so != -1 && pmatch[n+1].rm_eo != -1) \
87 int len = pmatch[n+1].rm_eo-pmatch[n+1].rm_so; \
88 __WVRE_REG(n).setsize(len+1); \
89 memcpy(__WVRE_REG(n).edit(), &string[pmatch[n+1].rm_so], len); \
90 __WVRE_REG(n).edit()[len] = '\0'; \
93 __WVRE_STORE_REGS( 0); __WVRE_STORE_REGS( 1);
94 __WVRE_STORE_REGS( 2); __WVRE_STORE_REGS( 3);
95 __WVRE_STORE_REGS( 4); __WVRE_STORE_REGS( 5);
96 __WVRE_STORE_REGS( 6); __WVRE_STORE_REGS( 7);
97 __WVRE_STORE_REGS( 8); __WVRE_STORE_REGS( 9);
98 __WVRE_STORE_REGS(10); __WVRE_STORE_REGS(11);
99 __WVRE_STORE_REGS(12); __WVRE_STORE_REGS(13);
100 __WVRE_STORE_REGS(14); __WVRE_STORE_REGS(15);
101 __WVRE_STORE_REGS(16); __WVRE_STORE_REGS(17);
102 __WVRE_STORE_REGS(18); __WVRE_STORE_REGS(19);
116 EXTENDED = REG_EXTENDED,
122 NEWLINE = REG_NEWLINE
124 static const int default_cflags;
137 static const int default_eflags;
157 {
set(regex, cflags); }
167 bool set(
WvStringParm regex,
int cflags = default_cflags);
185 int match_start, match_end;
186 return _match(
string, default_eflags,
187 match_start, match_end, WVREGEX_REGS_CALL);
199 int match_start, match_end;
200 return _match(
string, eflags,
201 match_start, match_end, WVREGEX_REGS_CALL);
231 int &match_start,
int &match_end,
232 WVREGEX_REGS_DECL)
const
234 return _match(
string, default_eflags,
235 match_start, match_end, WVREGEX_REGS_CALL);
251 int &match_start,
int &match_end,
252 WVREGEX_REGS_DECL)
const
254 return _match(
string, eflags,
255 match_start, match_end, WVREGEX_REGS_CALL);
bool continuable_match(WvStringParm string, int eflags, int &match_start, int &match_end, WVREGEX_REGS_DECL) const
Match a given string against the compiled regular expression, capturing the start and end positions o...
bool continuable_match(WvStringParm string, int &match_start, int &match_end, WVREGEX_REGS_DECL) const
Match a given string against the compiled regular expression, capturing the start and end positions o...
bool match(WvStringParm string, int eflags, WVREGEX_REGS_DECL) const
Match a given string against the compiled regular expression.