Regarding the luxury of using regexes - if your problem space fits a very specific model, you can still avoid the O(N) by using the technique outlined at Re: Massive regexp search and replace. With this particular implementation, I originally assumed that the idea was to loop over the regexes as you indicate with O(N) but then the usage in the example implied they index would be known. I probably read too much into it. Update: I should have said - either you are limited to integer dispatch values for O(1) or you will have to loop over the entire list O(N).
Cheers - L~R
In reply to Re^3: Subroutines in Dispatch Tables
by Limbic~Region
in thread Subroutines in Dispatch Tables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |