| commit | e669b61ecf6ae3af2a4f0c714c6723ccc073ecd5 | [log] [tgz] |
|---|---|---|
| author | Carlo Marcelo Arenas Belón <carenas@gmail.com> | Sun Jun 09 08:22:15 2024 -0700 |
| committer | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | Wed Nov 12 14:37:43 2025 +0000 |
| tree | 65bb034cc6c022e6c5b3fa452ee0da69a1c2b4b8 | |
| parent | 6ae58beca071f13ccfed31d03b3f479ab520639b [diff] |
pcre2test: memory reports only compiled memory usage for code/data (#418) Cherry-pick of 57906628d7babd27c01eb1c085d3e0cdd512189a. Since 05aafb2 (Implement pcre2_set_max_pattern_compiled_length() and set this limit in the fuzzer, 2024-04-24), the memory modifier has reported the full size of the allocated "code" returned by `pcre2_compile`. Problem is that the size of the structure used to hold that in memory also depends on the platform ABI and even alignment by the compiler, and has been therefore fragile to compare. Revert to reporting only the additional memory that `pcre2_compile()` will use for the compiled pattern (including any data tables) and make sure that the limit provided with `pcre2_set_max_pattern_compiled_length()` also avoid the internal struct overhead. Fixes: #415
The PCRE2 library is a set of C functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE2 has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API. The PCRE2 library is free, even for building proprietary software. It comes in three forms, for processing 8-bit, 16-bit, or 32-bit code units, in either literal or UTF encoding.
PCRE2 was first released in 2015 to replace the API in the original PCRE library, which is now obsolete and no longer maintained. As well as a more flexible API, the code of PCRE2 has been much improved since the fork.
As well as downloading from the GitHub site, you can download PCRE2 or the older, unmaintained PCRE1 library from an unofficial mirror at SourceForge.
You can check out the PCRE2 source code via Git or Subversion:
git clone https://github.com/PCRE2Project/pcre2.git svn co https://github.com/PCRE2Project/pcre2.git
If you just need the command-line PCRE2 tools on Windows, precompiled binary versions are available at this Rexegg page.
A PCRE2 port for z/OS, a mainframe operating system which uses EBCDIC as its default character encoding, can be found at http://www.cbttape.org (File 939).
You can read the PCRE2 documentation here.
Comparisons to Perl's regular expression semantics can be found in the community authored Wikipedia entry for PCRE.
There is a curated summary of changes for each PCRE release, copies of documentation from older releases, and other useful information from the third party authored RexEgg PCRE Documentation and Change Log page.
To report a problem with the PCRE2 library, or to make a feature request, please use the PCRE2 GitHub issues tracker. There is a mailing list for discussion of PCRE2 issues and development at pcre2-dev@googlegroups.com, which is where any announcements will be made. You can browse the list archives.