PCRE2_CODE_COPY(3)
π NAME π
okay so bestie, this page is PCRE2_CODE_COPY(3) and it lives in the Library Functions Manual β it's all about PCRE2 β Perl-compatible regular expressions (revised API). iconic, honestly. β¨
πΈ SYNOPSIS πΈ
#include <pcre2.h>
pcre2_code *pcre2_code_copy_with_tables(const pcre2_code *code);
π¦ DESCRIPTION π¦
so this function makes a copy of the memory used for a compiled pattern, but it excludes any memory used by the JIT compiler. no cap. π«Ά
without a subsequent call to pcre2_jit_compile(), the copy can be used only for non-JIT matching. periodt.
unlike pcre2_code_copy(), a separate copy of the character tables is also made, with the new code pointing to it. the way that's lowkey important iykyk π
this memory will be automatically freed when pcre2_code_free() is called. slay, no manual cleanup drama. π
the yield of the function is NULL if code is NULL or if sufficient memory cannot be obtained. π
there is a complete description of the PCRE2 native API in the pcre2api page and a description of the POSIX API in the pcre2posix page. go read those bestie, they're giving main character energy. π
fr fr: keep the JIT situation in mind β without pcre2_jit_compile(), that copy is only for non-JIT matching. π
peace out π β this page is from PCRE2 10.47, dated 16 January 2017. mwah π β¨
π¦ where this page comes from
- fedora 43: pcre2-devel 10.47-1.fc43 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 43: pcre2-devel 10.47-1.fc43 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 44: pcre2-devel 10.47-1.fc44.1 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 44: pcre2-devel 10.47-1.fc44.1 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms