P5RE
- a COM object unleashing the power of Perl 5 regular expressions in
Visual Basic
By Daniele Mezzetti
Wrapping the pcre library from Philip Hazel
The Regexp object encapsulates the regular expression.
|
Regexp.Pattern
is the default property, so that Atoms is the collection object of all patterns. You can iterate over it both with For..Next and with Foreach loop. Atoms(0) is the whole pattern match, Atoms(1..Atoms.Count) are the subpattern matches. Optimization allows for faster execution when the Regexp is used multiple times. Regexp supports locales via the .Locale method. Options can
be set with the SetOptions method or directly
during Match invocation. Options are:
P5RE supports error handling VB-style via the Err object. P5RE is built with '\n' (char 0x0A) as line separator. Beware that MS apps do not share a consistent behaviour: text coming from an Excel multi-line spreadsheet cell uses '\n', text coming from a textbox control has instead the infamous "\n\r" (chars 0x0D+0x0A) couple. I'll fix this someway someday. |
release
beta 0.2