Skip navigation.
 
ml[ANN] New version of RegexKit available
FROM : John Engelhart
DATE : Sat Dec 01 08:58:07 2007

RegexKit Version 0.5 Beta is now available.

http://regexkit.sourceforge.net/

RegexKit is a BSD licensed Objective-C framework for regular
expressions using the PCRE (v 7.4, latest) regular expression library.
Details of the API can be found in the frameworks extensive
documentation, available online at
http://regexkit.sourceforge.net/Documentation/

Some of the newer Mac OS X 10.5 Leopard features:

64 bit support. Pre-built for ppc, ppc64, i386, and x86_64.
Garbage Collection enabled. Complete support for Leopards Garbage
Collection feature.
Integrated Xcode 3.0 documentation. Get real time API information via
the Research Assistant.
Collection of instruments for Instruments.app.
RegexKit specific DTrace probe points.

Besides the obvious regular expression functionality, users here may
be interested in some of the other aspects of the framework since the
full source code is available under BSD license and can serve as a
working example that you can study, such as:

A starting point for incorporating an open source project within
Xcode.  RegexKit uses the PCRE library and includes an Xcode target
which downloads, './configure's, and builds the PCRE library for four
different architectures.  While RegexKit happens to build PCRE as a
static library for various reasons, I suspect it would be a
straightforward change to switch to dynamic libraries if thats what
you require.

A working example of Xcode DocSet functionality.  Occasionally it's
useful just to peer at another example.

Instruments.app and DTrace functionality.  Again, it's useful
sometimes to see working coe.  Adding custom DTrace probes to your
application is actually pretty simple, but I'm not aware of any
examples for Mac OS X currently.

If you're not yet familiar with DTrace, you need to become familiar
with it as soon as possible.  If you're a fan of Shark (btw, hats off
to the Shark group), you are going to love DTrace.  It's difficult to
describe DTrace, but it's extremely versatile.  As an example, using
DTrace and the new RegexKit probes, you can easily capture such
information from a shell:

shell% sudo dtrace -Z -q -n 'RegexKit*:::BeginMatch {
self->lookupStartTime = vtimestamp; }' -n 'RegexKit*:::EndMatch {
@lookups = lquantize(((vtimestamp - self->lookupStartTime) / 1000), 0,
20, 1); }'
[after a few seconds...]
^C


          value  ------------- Distribution ------------- count
              3 |                                        0
              4 |@@                                      32097
              5 |@@@@@@@@@                                149670
              6 |@@@@@@@@@@@@@@@@@                        263222
              7 |@@@@@@                                  95418
              8 |@                                        9145
              9 |                                        3628
              10 |@@                                      34463
              11 |@@                                      33117
              12 |                                        2608
              13 |                                        1849
              14 |                                        1433
              15 |                                        1071
              16 |                                        1032
              17 |                                        888
              18 |                                        674
              19 |                                        568
          >= 20 |                                        4197

This particular example, taken while the frameworks unit tests were
executing, graphs the distribution of the amount of time (in
microseconds) that the framework spent scanning a buffer for a match
of a regular expression.  With just a few trivial modifications to the
arguments, you can get average time distributions per regular
expression. Poor performing regular expressions would 'bubble to the
top' so you know where to focus your efforts.

Related mailsAuthorDate
ml[ANN] New version of RegexKit available John Engelhart Dec 1, 08:58
mlRe: [ANN] New version of RegexKit available Matt Neuburg Dec 4, 19:52
mlRe: [ANN] New version of RegexKit available John Engelhart Dec 4, 23:36
mlRe: [ANN] New version of RegexKit available Tom Davies Dec 4, 23:58
mlRe: [ANN] New version of RegexKit available Chris Hanson Dec 5, 00:35
mlRe: [ANN] New version of RegexKit available Matt Neuburg Dec 5, 06:01