PCRE2_JIT_MATCH(3)
π NAME π
okay bestie, welcome to PCRE2_JIT_MATCH(3) from the Library Functions Manual π
β¨. The NAME section is giving:
PCRE2 - Perl-compatible regular expressions (revised API)
π¦ SYNOPSIS π¦
#include <pcre2.h>
int pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject,
PCRE2_SIZE length, PCRE2_SIZE startoffset,
uint32_t options, pcre2_match_data *match_data,
pcre2_match_context *mcontext);
π DESCRIPTION π
okay so this function matches a compiled regular expression that has been successfully processed by the JIT compiler against a given subject string, using a matching algorithm that is similar to Perl's. It's a "fast path" interface to JIT, and it bypasses some of the sanity checks that pcre2_match() applies. slay for speed, but bestie, read the warnings π
β οΈ In UTF mode, the subject string is not checked for UTF validity. UnlessPCRE2_MATCH_INVALID_UTFwas set when the pattern was compiled, passing an invalid UTF string results in undefined behaviour. Your program may crash or loop or give wrong results. In the absence ofPCRE2_MATCH_INVALID_UTFyou should only callpcre2_jit_match()in UTF mode if you are sure the subject is valid. no cap, this is the serious bit π
The arguments for pcre2_jit_match() are exactly the same as for pcre2_match(), except that the subject string must be specified with a length; PCRE2_ZERO_TERMINATED is not supported. periodt.
The supported options are literally these six:
PCRE2_NOTBOLβ supported β¨PCRE2_NOTEOLβ supported β¨PCRE2_NOTEMPTYβ supported β¨PCRE2_NOTEMPTY_ATSTARTβ supported β¨PCRE2_PARTIAL_HARDβ supported β¨PCRE2_PARTIAL_SOFTβ supported β¨
Unsupported options are ignored. (not me having to say it, but okay π«Ά)
The return values are the same as for pcre2_match() plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is requested that was not compiled. For details of partial matching, see the pcre2partial page.
There is a complete description of the PCRE2 native API in the pcre2api page and a description of the JIT API in the pcre2jit page. go read those if you want the full lore ππ
mwah π that's the whole page, signed off from PCRE2 10.47, dated 20 January 2023 β bye bestie, stay valid in UTF mode π§ββοΈπ
π¦ 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