A portable C library implementing Perl-compatible regular expression pattern matching with Unicode support and optional JIT compilation.
PCRE2 is a free, open-source C library that implements Perl-compatible regular expression pattern matching. It provides a robust, portable solution for embedding regex functionality into software projects, supporting Unicode, multiple character encodings, and optional JIT compilation for high performance. It solves the need for a reliable, cross-platform regex engine that can be integrated into diverse applications and systems.
C/C++ developers and software engineers who need to embed regular expression capabilities into applications, libraries, or systems across various platforms, including those working on embedded systems, server software, or language implementations.
Developers choose PCRE2 for its proven reliability, extensive feature set (including Unicode and JIT), and exceptional portability. Its BSD licence allows use in proprietary software, and its design for easy embedding makes it a versatile choice for projects requiring a standalone, high-performance regex library.
PCRE2 development is based here.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements a dialect closely matching Perl 5, with flags to emulate other dialects like JavaScript or Python, ensuring broad compatibility for regex patterns.
Handles 8-bit, 16-bit, and 32-bit encodings including UTF and EBCDIC, with comprehensive Unicode property matching, making it versatile for international text processing.
Includes a just-in-time compiler that translates patterns to native machine code, significantly speeding up matching for performance-critical applications, as noted in the README.
Written in portable C99, tested on numerous platforms from Linux to z/OS, and designed for easy integration into existing projects, as highlighted in the overview.
The C API requires manual resource management, such as freeing match data and compiled patterns, which can be error-prone compared to higher-level wrappers in other languages.
Requires CMake or Autoconf for building, and JIT support needs a Git submodule, adding steps to the setup process that might complicate integration for simple projects.
The provided POSIX-compatible header does not support PCRE2-specific flags, reducing its usefulness for strict POSIX compliance without adopting the full API, as admitted in the README.