You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevents crashing in that case, and matches how other API calls handle
bad parameters.
It is also useful to simplify error checking in the caller side, as it
allows delaying checks for compiler failure and handling it together with
a match data creation failure.
This function creates a new match data block for holding the result of a match.
18
-
The first argument points to a compiled pattern. The number of capturing
19
-
parentheses within the pattern is used to compute the number of pairs of
20
-
offsets that are required in the match data block. These form the "output
21
-
vector" (ovector) within the match data block, and are used to identify the
22
-
matched string and any captured substrings when matching with
23
-
\fBpcre2_match()\fP. If you are using \fBpcre2_dfa_match()\fP, which uses the
24
-
output vector in a different way, you should use \fBpcre2_match_data_create()\fP
25
-
instead of this function.
18
+
If the first argument is NULL, this function returns NULL, otherwise The first
19
+
argument points to a compiled pattern. The number of capturing parentheses
20
+
within the pattern is used to compute the number of pairs of offsets that are
21
+
required in the match data block. These form the "output vector" (ovector)
22
+
within the match data block, and are used to identify the matched string and
23
+
any captured substrings when matching with \fBpcre2_match()\fP. If you are
24
+
using \fBpcre2_dfa_match()\fP, which uses the output vector in a different way, you should use \fBpcre2_match_data_create()\fP instead of this function.
26
25
.P
27
26
The second argument points to a general context, for custom memory management,
28
-
or is NULL to use the same memory allocator as was used for the compiled
27
+
or is NULL to use the same memory allocator that was used for the compiled
29
28
pattern. The result of the function is NULL if the memory for the block could
30
-
not be obtained.
29
+
not be obtained or if NULL was provided as the first argument.
31
30
.P
32
31
There is a complete description of the PCRE2 native API in the
0 commit comments