[Gambas-devel] 1.9.1 pcre problem diagnosed

Benoit Minisini gambas at ...1...
Wed Jan 12 16:14:38 CET 2005


On Wednesday 12 January 2005 15:14, Rob wrote:
> On Wednesday 12 January 2005 04:04, Benoit Minisini wrote:
> > Could it be possible to compile the regexp first, and then use
> > the compiled regexp later may times ?
>
> Yes, that would make it much faster to process large text files
> for example.
>
> So what I want to do is this:
>
> 1. have a method called Regexp.Compile
>
> 2. have a method called Regexp.Exec
>
> 3. check for the existence of the "subject" and "pattern" args in
> the constructor, and if they exist, then call Compile and then
> Exec (as I'm doing now, but with more indirection.
>
> Are there any existing components with classes that do this? I 
> actually don't know how to call one method of a Gambas class
> from another in C... do I use the Gambas symbol (CREGEXP_compile
> for example) or do I write private C functions called
> "regexpcompile()" and "regexpexec()" in regexp.c and call them
> from all three methods?
>
> Rob
>

Look at the gb.eval component. It compiles and evaluates Gambas expressions 
located in a string. Almost exactly the same thing as you do with regexp!

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the Devel mailing list