@@ -42,40 +42,37 @@ POSSIBILITY OF SUCH DAMAGE.
4242/* The current PCRE version information. */
4343
4444#define PCRE2_MAJOR 10
45- #define PCRE2_MINOR 44
45+ #define PCRE2_MINOR 49
4646#define PCRE2_PRERELEASE
47- #define PCRE2_DATE 2024-06-07
47+ #define PCRE2_DATE 2026-09-28
4848
49- /* When an application links to a PCRE DLL in Windows, the symbols that are
49+ /* When an application links to a PCRE2 DLL in Windows, the symbols that are
5050imported have to be identified as such. When building PCRE2, the appropriate
51- export setting is defined in pcre2_internal.h, which includes this file. So we
52- don't change existing definitions of PCRE2_EXP_DECL. */
51+ export setting is defined in pcre2_internal.h, which includes this file. So, we
52+ don't change existing definitions of PCRE2_EXP_DECL.
5353
54- #if defined(_WIN32 ) && !defined(PCRE2_STATIC )
55- # ifndef PCRE2_EXP_DECL
56- # define PCRE2_EXP_DECL extern __declspec(dllimport)
57- # endif
58- #endif
59-
60- /* By default, we use the standard "extern" declarations. */
54+ By default, we use the standard "extern" declarations. */
6155
6256#ifndef PCRE2_EXP_DECL
63- # ifdef __cplusplus
57+ # if defined(_WIN32 ) && !defined(PCRE2_STATIC )
58+ # define PCRE2_EXP_DECL extern __declspec(dllimport)
59+ # elif defined __cplusplus
6460# define PCRE2_EXP_DECL extern "C"
6561# else
6662# define PCRE2_EXP_DECL extern
6763# endif
6864#endif
6965
7066/* When compiling with the MSVC compiler, it is sometimes necessary to include
71- a "calling convention" before exported function names. (This is secondhand
72- information; I know nothing about MSVC myself). For example, something like
67+ a "calling convention" before exported function names. For example:
7368
7469 void __cdecl function(....)
7570
76- might be needed. In order so make this easy, all the exported functions have
77- PCRE2_CALL_CONVENTION just before their names. It is rarely needed; if not
78- set, we ensure here that it has no effect. */
71+ might be needed. In order to make this easy, all the exported functions have
72+ PCRE2_CALL_CONVENTION just before their names.
73+
74+ PCRE2 normally uses the platform's standard calling convention, so this should
75+ not be set unless you know you need it. */
7976
8077#ifndef PCRE2_CALL_CONVENTION
8178#define PCRE2_CALL_CONVENTION
@@ -143,6 +140,7 @@ D is inspected during pcre2_dfa_match() execution
143140#define PCRE2_EXTENDED_MORE 0x01000000u /* C */
144141#define PCRE2_LITERAL 0x02000000u /* C */
145142#define PCRE2_MATCH_INVALID_UTF 0x04000000u /* J M D */
143+ #define PCRE2_ALT_EXTENDED_CLASS 0x08000000u /* C */
146144
147145/* An additional compile options word is available in the compile context. */
148146
@@ -159,13 +157,18 @@ D is inspected during pcre2_dfa_match() execution
159157#define PCRE2_EXTRA_ASCII_BSW 0x00000400u /* C */
160158#define PCRE2_EXTRA_ASCII_POSIX 0x00000800u /* C */
161159#define PCRE2_EXTRA_ASCII_DIGIT 0x00001000u /* C */
160+ #define PCRE2_EXTRA_PYTHON_OCTAL 0x00002000u /* C */
161+ #define PCRE2_EXTRA_NO_BS0 0x00004000u /* C */
162+ #define PCRE2_EXTRA_NEVER_CALLOUT 0x00008000u /* C */
163+ #define PCRE2_EXTRA_TURKISH_CASING 0x00010000u /* C */
162164
163165/* These are for pcre2_jit_compile(). */
164166
165167#define PCRE2_JIT_COMPLETE 0x00000001u /* For full matching */
166168#define PCRE2_JIT_PARTIAL_SOFT 0x00000002u
167169#define PCRE2_JIT_PARTIAL_HARD 0x00000004u
168170#define PCRE2_JIT_INVALID_UTF 0x00000100u
171+ #define PCRE2_JIT_TEST_ALLOC 0x00000200u
169172
170173/* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and
171174pcre2_substitute(). Some are allowed only for one of the functions, and in
@@ -318,9 +321,29 @@ pcre2_pattern_convert(). */
318321#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195
319322#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196
320323#define PCRE2_ERROR_TOO_MANY_CAPTURES 197
321- #define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED 198
324+ #define PCRE2_ERROR_MISSING_OCTAL_DIGIT 198
322325#define PCRE2_ERROR_BACKSLASH_K_IN_LOOKAROUND 199
323-
326+ #define PCRE2_ERROR_MAX_VAR_LOOKBEHIND_EXCEEDED 200
327+ #define PCRE2_ERROR_PATTERN_COMPILED_SIZE_TOO_BIG 201
328+ #define PCRE2_ERROR_OVERSIZE_PYTHON_OCTAL 202
329+ #define PCRE2_ERROR_CALLOUT_CALLER_DISABLED 203
330+ #define PCRE2_ERROR_EXTRA_CASING_REQUIRES_UNICODE 204
331+ #define PCRE2_ERROR_TURKISH_CASING_REQUIRES_UTF 205
332+ #define PCRE2_ERROR_EXTRA_CASING_INCOMPATIBLE 206
333+ #define PCRE2_ERROR_ECLASS_NEST_TOO_DEEP 207
334+ #define PCRE2_ERROR_ECLASS_INVALID_OPERATOR 208
335+ #define PCRE2_ERROR_ECLASS_UNEXPECTED_OPERATOR 209
336+ #define PCRE2_ERROR_ECLASS_EXPECTED_OPERAND 210
337+ #define PCRE2_ERROR_ECLASS_MIXED_OPERATORS 211
338+ #define PCRE2_ERROR_ECLASS_HINT_SQUARE_BRACKET 212
339+ #define PCRE2_ERROR_PERL_ECLASS_UNEXPECTED_EXPR 213
340+ #define PCRE2_ERROR_PERL_ECLASS_EMPTY_EXPR 214
341+ #define PCRE2_ERROR_PERL_ECLASS_MISSING_CLOSE 215
342+ #define PCRE2_ERROR_PERL_ECLASS_UNEXPECTED_CHAR 216
343+ #define PCRE2_ERROR_EXPECTED_CAPTURE_GROUP 217
344+ #define PCRE2_ERROR_MISSING_OPENING_PARENTHESIS 218
345+ #define PCRE2_ERROR_MISSING_NUMBER_TERMINATOR 219
346+ #define PCRE2_ERROR_NULL_ERROROFFSET 220
324347
325348/* "Expected" matching error codes: no match and partial match. */
326349
@@ -407,6 +430,15 @@ released, the numbers must not be changed. */
407430#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
408431#define PCRE2_ERROR_DFA_UINVALID_UTF (-66)
409432#define PCRE2_ERROR_INVALIDOFFSET (-67)
433+ #define PCRE2_ERROR_JIT_UNSUPPORTED (-68)
434+ #define PCRE2_ERROR_REPLACECASE (-69)
435+ #define PCRE2_ERROR_TOOLARGEREPLACE (-70)
436+ #define PCRE2_ERROR_DIFFSUBSPATTERN (-71)
437+ #define PCRE2_ERROR_DIFFSUBSSUBJECT (-72)
438+ #define PCRE2_ERROR_DIFFSUBSOFFSET (-73)
439+ #define PCRE2_ERROR_DIFFSUBSOPTIONS (-74)
440+ #define PCRE2_ERROR_BAD_BACKSLASH_K (-75)
441+ #define PCRE2_ERROR_PARTIALSUBS (-76)
410442
411443
412444/* Request types for pcre2_pattern_info() */
@@ -459,7 +491,32 @@ released, the numbers must not be changed. */
459491#define PCRE2_CONFIG_NEVER_BACKSLASH_C 13
460492#define PCRE2_CONFIG_COMPILED_WIDTHS 14
461493#define PCRE2_CONFIG_TABLES_LENGTH 15
494+ #define PCRE2_CONFIG_EFFECTIVE_LINKSIZE 16
495+
496+ /* Optimization directives for pcre2_set_optimize().
497+ For binary compatibility, only add to this list; do not renumber. */
498+
499+ #define PCRE2_OPTIMIZATION_NONE 0
500+ #define PCRE2_OPTIMIZATION_FULL 1
501+
502+ #define PCRE2_AUTO_POSSESS 64
503+ #define PCRE2_AUTO_POSSESS_OFF 65
504+ #define PCRE2_DOTSTAR_ANCHOR 66
505+ #define PCRE2_DOTSTAR_ANCHOR_OFF 67
506+ #define PCRE2_START_OPTIMIZE 68
507+ #define PCRE2_START_OPTIMIZE_OFF 69
462508
509+ /* Types used in pcre2_set_substitute_case_callout().
510+
511+ PCRE2_SUBSTITUTE_CASE_LOWER and PCRE2_SUBSTITUTE_CASE_UPPER are passed to the
512+ callout to indicate that the case of the entire callout input should be
513+ case-transformed. PCRE2_SUBSTITUTE_CASE_TITLE_FIRST is passed to indicate that
514+ only the first character or glyph should be transformed to Unicode titlecase,
515+ and the rest to lowercase. */
516+
517+ #define PCRE2_SUBSTITUTE_CASE_LOWER 1
518+ #define PCRE2_SUBSTITUTE_CASE_UPPER 2
519+ #define PCRE2_SUBSTITUTE_CASE_TITLE_FIRST 3
463520
464521/* Types for code units in patterns and subject strings. */
465522
@@ -613,7 +670,9 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
613670 pcre2_set_parens_nest_limit(pcre2_compile_context *, uint32_t); \
614671PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
615672 pcre2_set_compile_recursion_guard(pcre2_compile_context *, \
616- int (*)(uint32_t, void *), void *);
673+ int (*)(uint32_t, void *), void *); \
674+ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
675+ pcre2_set_optimize(pcre2_compile_context *, uint32_t);
617676
618677#define PCRE2_MATCH_CONTEXT_FUNCTIONS \
619678PCRE2_EXP_DECL pcre2_match_context *PCRE2_CALL_CONVENTION \
@@ -628,6 +687,11 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
628687PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
629688 pcre2_set_substitute_callout(pcre2_match_context *, \
630689 int (*)(pcre2_substitute_callout_block *, void *), void *); \
690+ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
691+ pcre2_set_substitute_case_callout(pcre2_match_context *, \
692+ PCRE2_SIZE (*)(PCRE2_SPTR, PCRE2_SIZE, PCRE2_UCHAR *, PCRE2_SIZE, int, \
693+ void *), \
694+ void *); \
631695PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
632696 pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
633697PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -687,14 +751,14 @@ PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \
687751PCRE2_EXP_DECL pcre2_match_data *PCRE2_CALL_CONVENTION \
688752 pcre2_match_data_create_from_pattern(const pcre2_code *, \
689753 pcre2_general_context *); \
754+ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
755+ pcre2_match_data_free(pcre2_match_data *); \
690756PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
691757 pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
692758 uint32_t, pcre2_match_data *, pcre2_match_context *, int *, PCRE2_SIZE); \
693759PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
694760 pcre2_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
695761 uint32_t, pcre2_match_data *, pcre2_match_context *); \
696- PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
697- pcre2_match_data_free(pcre2_match_data *); \
698762PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
699763 pcre2_get_mark(pcre2_match_data *); \
700764PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
@@ -706,7 +770,9 @@ PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
706770PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \
707771 pcre2_get_ovector_pointer(pcre2_match_data *); \
708772PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
709- pcre2_get_startchar(pcre2_match_data *);
773+ pcre2_get_startchar(pcre2_match_data *); \
774+ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
775+ pcre2_next_match(pcre2_match_data *, PCRE2_SIZE *, uint32_t *);
710776
711777
712778/* Convenience functions for handling matched substrings. */
@@ -740,6 +806,7 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
740806PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
741807 pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
742808
809+
743810/* Functions for serializing / deserializing compiled patterns. */
744811
745812#define PCRE2_SERIALIZE_FUNCTIONS \
@@ -885,6 +952,7 @@ pcre2_compile are called by application code. */
885952#define pcre2_match_data_create PCRE2_SUFFIX(pcre2_match_data_create_)
886953#define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_)
887954#define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_)
955+ #define pcre2_next_match PCRE2_SUFFIX(pcre2_next_match_)
888956#define pcre2_pattern_convert PCRE2_SUFFIX(pcre2_pattern_convert_)
889957#define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_)
890958#define pcre2_serialize_decode PCRE2_SUFFIX(pcre2_serialize_decode_)
@@ -907,7 +975,9 @@ pcre2_compile are called by application code. */
907975#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
908976#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
909977#define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_)
978+ #define pcre2_set_optimize PCRE2_SUFFIX(pcre2_set_optimize_)
910979#define pcre2_set_substitute_callout PCRE2_SUFFIX(pcre2_set_substitute_callout_)
980+ #define pcre2_set_substitute_case_callout PCRE2_SUFFIX(pcre2_set_substitute_case_callout_)
911981#define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_)
912982#define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_)
913983#define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
0 commit comments