YuPcre2 is built upon the PCRE2 library, a collection of C functions designed to execute regular expression pattern matching with syntax and semantics akin to Perl 5. PCRE2 provides its native API and includes a set of wrapper functions mirroring the POSIX regular expression API. Notably, the PCRE2 library is freely available to developpment of proprietary software without licensing constraints. It offers versatility by coming in three variations, tailored for processing 8-bit, 16-bit, or 32-bit code units, and supports literal and UTF encoding.
YuPcre2 introduces two distinct matching algorithms: the standard Perl algorithm and an alternative DFA algorithm, offering users flexibility based on their specific needs. The Perl algorithm, reminiscent of Perl and JavaScript, is fast, supporting comprehensive pattern syntax and proving suitable for most scenarios. On the other hand, the DFA algorithm is specialized, identifying all possible matches, notably the longest ones, without backtracking. It excels in partial matching, particularly in multi-segment matching of lengthy subject strings.
Key Features of YuPcre2:
- The YuPcre2 RegEx2 classes share common ancestors, providing essential functionalities such as:
- Matching strings and extracting full or substring matches.
- Searching for regular expressions within streams and memory buffers. TDIRegExSearchStream descendants employ buffered search within streams and files, utilizing minimal memory even for vast datasets.
- Replacing full matches or partial substrings.
- Listing full matches or partial substrings.
- Formatting full matches or partial substrings by adding static or dynamic text.
For users familiar with DIRegEx, exploring the distinctions between YuPcre2 and DIRegEx might be interesting.
- YuPcre2 facilitates various string processing operations, including the ability to Replace, List, or Format regular expression matches or their substrings. This functionality proves valuable for text editors and word processors. Users can include variable portions of the match in the result text, referencing the entire match by number and substrings by name. The character that introduces these references is configurable, and FormatOptions offers control over specific features.
- Replace returns the original subject string with replaced matches, offering greater flexibility than Delphi's StringReplace() function.
- List consolidates all string matches into a single string, enabling the extraction of multiple phone numbers, email addresses, or URLs with a single call.
- Additionally, YuPcre2 includes two regular expression mask edits: TDIRegEx2MaskEdit and TDIRegEx2ComboBox. These controls validate keyboard input against a regular expression, functioning similarly to Delphi's TMaskEdit but with increased flexibility and power. The regular expression mask edits can:
- Accept or reject specific characters at defined positions.
- Allow or reject particular characters based on preceding defined character(s).
- Restrict input text to begin or end with a specific character(s).
- Flag incomplete text to indicate the need for additional input.
- Applicable scenarios include validating numbers, number ranges, dates, phone numbers, email addresses, URLs, currency, etc.
- TDIRegEx2MaskEdit
- TDIRegEx2MaskComboBox
Click on the links below to Download the latest version of YuPcre2 with CRACK!