Q2: Regex anyone?
Andrew C. Greenberg
werdna at gate.net
Wed May 24 00:56:59 UTC 2000
At 8:06 PM +0200 5/23/2000, Stefan Matthias Aust wrote:
>At 19:16 23.05.00 +0200, Stefan Matthias Aust wrote:
>>I was looking for some perl-style regular expression code for
>>Squeak. Searching the web I found some Squeak code written by
>>Andrew C Green [...]
>
>Bad habit to quote oneself, I know, but I want to add an additional
>question after I found out that Andrew's code allows \1
>backreferences: Has anybody tested this on 2.8a and even prepared a
>plugin for Solaris 7?
My plugin still works on 2.8a, though it could certainly use an
interface shakedown (it was one of my first Squeak projects). The
code is utterly plain vanilla C, and should compile on any platform
-- the key question is supporting the memory management model. The
only tricky platform in that regard was MacOS. I would start with
the HP-UX code if you are so inclined.
The reason I chose PCRE, as opposed to a Smalltalk implementation was
two-fold: (1) I couldn't find a Perl-compatible Smalltalk
implementation, indeed, even one that was close; and (2) PCRE is a
solid, regularly-maintained implementation, written in a highly
portable language.
PCRE is the library used in Python, in PhP4 and in various other
high-visibility projects. This is not to vouch for its virtues, but
merely to suggest that a solid user-base is committed to testing and
maintaining it.
Any Smalltalk-based implementation would likely run substantially
slower, unless hacked so that it could be pluginized. On the other
hand, it seemed unlikely that anyone would built such a plugin and
maintain it as agressively and consistently as Hazel has PCRE.
I had intended to build a Smalltalk/Plugin version of PCRE based on
the original code, but got distracted by other projects -- the
existing code worked very well, and other functionality that didn't
exist seemed to want to be built first.
If there is any interest, I'd be inclined to do a rebuild of the
plugin for the most recent PCRE version.
--
Andrew C. Greenberg acg at netwolves.com
V.P. Eng., R&D, 813.885.2779 (office)
Netwolves Corporation 813.885.2380 (facsimile)
www.netwolves.com
More information about the Squeak-dev
mailing list
|