6 |
|
|
7 |
|
#include "Matcher.hpp" |
8 |
|
|
9 |
< |
Matcher::Matcher(const ext::String& expression) |
9 |
> |
Matcher::Matcher(const ext::String& expression) : expression(NULL) |
10 |
|
{ |
11 |
– |
this->expression = NULL; |
12 |
– |
|
11 |
|
(*this)(expression); |
12 |
|
} |
13 |
|
|
29 |
|
|
30 |
|
pcre_fullinfo(expression, NULL, PCRE_INFO_CAPTURECOUNT, &length); |
31 |
|
|
32 |
< |
int* substrings = new int[(++length *= 3)]; |
33 |
< |
int count = pcre_exec(expression, NULL, stuff.c_str(), stuff.length(), |
34 |
< |
0, 0, substrings, length); |
32 |
> |
int* substrings(new int[(++length *= 3)]); |
33 |
> |
int count(pcre_exec(expression, NULL, stuff.c_str(), stuff.length(), 0, 0, |
34 |
> |
substrings, length)); |
35 |
|
|
36 |
|
if (count > 0) |
37 |
|
{ |
38 |
< |
char* substring = new char[stuff.length() + 1]; |
38 |
> |
char* substring(new char[stuff.length() + 1]); |
39 |
|
|
40 |
< |
for (int index = 0; index < count; index++) |
40 |
> |
for (int index(0); index < count; ++index) |
41 |
|
{ |
42 |
|
pcre_copy_substring(stuff.c_str(), substrings, count, index, |
43 |
|
substring, stuff.length() + 1); |