PCRE Regular Expression Library

PCRE Regular Expression Library

www.pcre.org

2

About this website

PCRE (Perl Compatible Regular Expressions) is a C library implementing regular expression pattern matching using the same syntax and semantics as Perl 5. Originally written by Philip Hazel in 1997 at the University of Cambridge, PCRE has become the most widely used regular expression library, embedded in countless applications and programming languages. Key features: Perl 5 compatible regular expression syntax including character classes, quantifiers, anchors, alternation, grouping, backreferences, and look-ahead and look-behind assertions. PCRE2 (current generation, released 2015) is a complete rewrite replacing the original PCRE library, with improved code structure, better Unicode support, and new features. UTF-8, UTF-16, and UTF-32 Unicode support including Unicode character properties (categories, scripts, blocks), case-insensitive matching with Unicode case folding, and grapheme cluster matching. JIT (Just-In-Time) compilation of regular expressions for significantly faster matching (2-10x speedup) on supported architectures (x86, x86_64, ARM, ARM64, MIPS, PowerPC, SPARC). Named subpatterns and named captures for more readable patterns. Atomic groups and possessive quantifiers for preventing catastrophic backtracking in complex patterns. Recursive patterns for matching nested structures (balanced parentheses, HTML tags). Callouts for embedding code execution during pattern matching. DFA (Deterministic Finite Automaton) matching algorithm as an alternative to the NFA backtracking algorithm for guaranteed linear-time matching. Alternative functions for different calling conventions and usage patterns. Thread-safe design with no global state. Configurable recursion depth limits and match limits for DoS protection. Used by Apache httpd (mod_rewrite), Postfix, Nginx, PHP, R, Exim, Safari, and thousands of applications. Open source under BSD license.

Tags & Categories

Statistics

2
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!