1PCRE2_MATCH_DATA_CREATE_FROML_iPbArTaTrEyRNF(u3n)ctPiCoRnEs2_MMaAnTuCaHl_DATA_CREATE_FROM_PATTERN(3)
2
3
4
6 PCRE2 - Perl-compatible regular expressions (revised API)
7
9
10 #include <pcre2.h>
11
12 pcre2_match_data *pcre2_match_data_create_from_pattern(
13 const pcre2_code *code, pcre2_general_context *gcontext);
14
16
17 This function creates a new match data block for holding the result of
18 a match. The first argument points to a compiled pattern. The number
19 of capturing parentheses within the pattern is used to compute the num‐
20 ber of pairs of offsets that are required in the match data block.
21 These form the "output vector" (ovector) within the match data block,
22 and are used to identify the matched string and any captured substrings
23 when matching with pcre2_match(). If you are using pcre2_dfa_match(),
24 which uses the output vector in a different way, you should use
25 pcre2_match_data_create() instead of this function.
26
27 The second argument points to a general context, for custom memory man‐
28 agement, or is NULL to use the same memory allocator as was used for
29 the compiled pattern. The result of the function is NULL if the memory
30 for the block could not be obtained.
31
32 There is a complete description of the PCRE2 native API in the pcre2api
33 page and a description of the POSIX API in the pcre2posix page.
34
35
36
37PCRE2 10.38 28 AugusPtCR2E022_1MATCH_DATA_CREATE_FROM_PATTERN(3)