in reply to Re: Re: Re: Hash/Array of Regular Expressions?
in thread Hash/Array of Regular Expressions?

Sorry to mislead you; the callbacks don't have to do the same thing. I just had them that way so I could verify that the code worked and get the count of matching lines. I've changed it to use different callbacks.

I suspect that a matching module like you describe could be adaptive: it could change its strategy depending on the hit/miss ratio and the number of regexes it had to match.

  • Comment on Re: Re: Re: Re: Hash/Array of Regular Expressions?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Hash/Array of Regular Expressions?
by Aighearach (Initiate) on Jun 25, 2001 at 02:05 UTC
    I wasn't really meaning the actual text of your example, as it's just an example, I'm just saying that in this case whether you actually need the callbacks to be different is what determines the best data structure to use.
    --
    Snazzy tagline here