PCRE -вектор смещения, кратный 3?

Я изучаю PCRE и не понимаю, почему вектор смещения должен быть кратен 3. Это из pcredemo.c(rcявляется результатомpcre_exec()):

/* The output vector wasn't big enough */

if (rc == 0) {
    rc = OVECCOUNT / 3;
    printf("ovector only has room for %d captured substrings\n", rc - 1);
}

/* Show substrings stored in the output vector by number. Obviously, in a real
 * application you might want to do things other than print them. */

for (i = 0; i < rc; i++) {
    char *substring_start = subject + ovector[2 * i];
    int substring_length = ovector[2 * i + 1] - ovector[2 * i];
    printf("%2d: %.*s\n", i, substring_length, substring_start);
}

Мне кажется, что ovector хранит str1_start, str1_end, str2_start, str2_end,..., поэтому массив может содержать строки OVECCOUNT/2. Почему OVECOUNT/3?

Спасибо.

5
задан woky 16 August 2012 в 19:15
поделиться