compat.pcre2
#includePCRE2 10.44 — 8-bit Perl-compatible regular expressions with Unicode properties, the dependency glib's GRegex is written against
#include <pcre2.h>
mcpp add compat.pcre2@10.44
Usage
From this repository's own test project — built and run by CI, not written for the website.
// compat.pcre2 — exercised the way glib's GRegex uses it.
//
// WHAT THIS ASSERTS AND WHY EACH ONE IS HERE
//
// The failures worth catching in a regex engine are not "it did not link".
// They are the ones where the library builds, links, runs, and gives a subtly
// wrong answer because a probe macro said something untrue. Each check below
// names a specific decision in the descriptor:
//
// compile + match the sources really were compiled, not just linked
// \p{Han} / \X SUPPORT_UNICODE, i.e. that pcre2_ucd.c's tables are in
// PCRE2_UTF that UTF-8 mode works, which is all glib ever uses
// the character tables that pcre2_chartables.c.dist was compiled, and in the
// C locale — the file the descriptor does NOT let a
// `pcre2_dftables` run produce from the build machine
// pcre2_config(JIT) that JIT is OFF and SAYS so, rather than crashing
// capture groups pcre2_substring_*, which glib's g_match_info_fetch is
#ifdef __linux__
// ⚠️ REQUIRED BEFORE THE HEADER, and pcre2.h says so with an #error if it is
// missing. The header uses it to choose which of the three code-unit widths to
// …
tests/examples/pcre2/tests/pcre2.cpp · project tests/examples/pcre2
Build
- targets
pcre2-8 (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
mcpp_generated, */src, *
Sources (28)
*/src/pcre2_auto_possess.cmcpp_generated/pcre2_chartables.c*/src/pcre2_chkdint.c*/src/pcre2_compile.c*/src/pcre2_config.c*/src/pcre2_context.c*/src/pcre2_convert.c*/src/pcre2_dfa_match.c*/src/pcre2_error.c*/src/pcre2_extuni.c*/src/pcre2_find_bracket.c*/src/pcre2_jit_compile.c*/src/pcre2_maketables.c*/src/pcre2_match.c*/src/pcre2_match_data.c*/src/pcre2_newline.c*/src/pcre2_ord2utf.c*/src/pcre2_pattern_info.c*/src/pcre2_script_run.c*/src/pcre2_serialize.c*/src/pcre2_string_utils.c*/src/pcre2_study.c*/src/pcre2_substitute.c*/src/pcre2_substring.c*/src/pcre2_tables.c*/src/pcre2_ucd.c*/src/pcre2_valid_utf.c*/src/pcre2_xclass.c
Generated files
mcpp_generated/config.hmcpp_generated/pcre2.hmcpp_generated/pcre2_chartables.c