in reply to Re^4: Runtime Regexp Generation (I agree, but...)
in thread Runtime Regexp Generation

I wrote a generic log-reader combined with a custom query language (looked like SQL, and I based it on Parse::RecDescent) several years ago. It supported reading fields from comma(or anything else)-separated records, regex-separated records, or a custom regex. Once an object was defined, each read would return an array wanted fields from the next line, that were fed to precompiled query for evaluation.

I don't have the code handy, but this solution can be abstracted very nicely. One gotcha is that it was quite slow, esp. if regular expressions were used to extract values from each line (I'm talking hundreds of megabytes of logs).

  • Comment on Re: Re^4: Runtime Regexp Generation (I agree, but...)