[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: regular expressions - compile time check
- From: "Andrei A. Voropaev" <avorop@...>
- Date: Mon, 30 Jun 2003 15:39:20 +0200
On Mon, Jun 30, 2003 at 12:47:42PM +0000, David Jones wrote:
....
> Put all your patterns in a table. This will simplify the lookup
> procedure and allow you to check the patterns. It won't be "compile
> time" but will be "ahead of time":
>
> t = {
> "some_pattern",
> "some_pattern2",
> "some_pattern3"
> }
>
....
I thought about this as well. But this is not very practical solution. Imagine
100 patterns that have to be taken out of context and put into table. And then
in the code maintainer would have to point to correct slot in the table. That
is why I decided to go with extra run thru regular expressions, kind of
"before compilation check". It just looks kind of dirty: parsing before
parsing.
Andrei