- Regular Expressions tool (help wanted?)

From: Greg Edwards <"Greg>
Date: Wed, 5 Apr 2006 22:22:22 -0700

----boundary-LibPST-iamunique-1333824641_-_-
Content-type: text/plain

Two issues (or questions):
1) the license for CpcRegul does not allow commercial use (PCRE doesn't have
that limitation) -- really, this issue alone warrants coming up with an
alternate solution.
2) CpcRegul makes use of Babel, which has this in its documentation:
>Babel is a meta compiler. From a language definition document, it builds
>the tables of a compiler (lexical, syntactic and semantic) and store them
>in a binary file. A special module, included in the final program, reads
>this file and then can compile texts of the language.

That sounds like it's good if you have 1 or 2 thing you'll be matching,
given that it has to **create** binary files. But, if you want to use it all
the time for big AND small things, then it sounds cumbersome. I've recently
been using Ruby which has regular expressions built in, and it's nice to be
able to do matching all the time with no thought.

My sense was that it would be worth having a DLL interface generated for
PCRE, and then write a couple wrapper functions that make it easy to use it
frequently for big and small needs.


Greg Edwards
CTO, Eyetools Inc.
gedwards1{([at]})nowhere.xy
(916) 792 4538
-----Original Message-----
From: blackbox{([at]})nowhere.xy
Meunier
Sent: Wednesday, April 05, 2006 10:05 AM
To: BlackBox Mailing List
Subject: [BlackBox] - Regular Expressions tool (help wanted?)

Douglas G. Danforth a écrit :

>*From:* Greg [mailto:gedwards{([at]})nowhere.xy
>*Sent:* Saturday, March 25, 2006 11:14 AM
>*To:* Blackbox Mailing list (blackbox{([at]})nowhere.xy
>*Cc:* 'gedwards1{([at]})nowhere.xy
>*Subject:* Regular Expressions tool (help wanted?)
>
>
>Anyone interested in helping with getting good regular-expression support
in BB?
>It helps with a lot of common programming tasks having a good
regular-expression
>search / replace.
>
>
>PCRE (
http://www.pcre.org/ ) is a cross-platform, very robust,
open-source,
>fast, easy to use library for doing regular expression matching on any
text. It
>has a Windows binary DLL already for download and use, with example code, a
.h
>file, and source.
>
>
>I’d like to create a wrapper in Blackbox for the DLL and start using it all
over
>the place.
>
>
>I’d guess it will take 30 minutes of effort IF SOMEONE KNOWS HOW TO WRAP
DLLS
>WITH POINTERS TO STRUCTS AND IN/OUT ARRAYS.
>
>
>I’ve done some wrapping of DLLs in the past, but it always took me a while
to
>work out the “I need to pass this array of integers/characters into the DLL
so
>that the DLL can fill it with stuff” issues, so I’m hoping someone has done
this
>recently and remembers clearly the best way to do it.
>
>
>IF SOMEONE CAN HELP WITH THAT, THEN I WILL produce example code that others
can
>use to easily integrate search/replace into a BB program.
>
>
>Let me know if you’d be interesting in collaborating.
>
>
>
>-- From the PCRE website:
>
>“PCRE - Perl-compatible regular expressions
>
>The PCRE library is a set of functions that implement regular expression
pattern
>matching using the same syntax and semantics as Perl 5.”
>
>
>PCRE is an open
>
>
>I’m about to embark on what will probably be a pretty easy process of
wrapping
>the PC
>
>
>
>
>Greg Edwards
>
>CTO, Eyetools Inc.
>
>gedwards1{([at]})nowhere.xy
>
>(916) 792 4538
>
>
Doug,

Have you considered the subsystem "CpcRegul"?

http://www.zinnamturm.de/#CpcRegul

It can search any regular expression in texts, and I have been using it
without problems for several years. Its syntax is not exactly the same
as PCRE, but very close. It can also replace found patterns by strings.
CpcEverywhere (http://www.zinnamturm.de/#CpcEverywhere) uses the same
search engine to do pattern matching in files.

Cheers.

Gérard

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



----boundary-LibPST-iamunique-1333824641_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJ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