There are probably more and less efficient possible orderings of all the elements in your set, and very probably you can transform the regexp into something with shared prefixes and stuff, but to do that correctly you also need to know/make assumptions about the distribution of your input. For general purpose programming and in most cases, just assembling something like what's in your original post is fine.
Of course, if you do need to match many timesm or if the alternate lists grow huge, you will need to optimize things. | [reply] |
Thanks, gaal! I get the idea now :)
| [reply] |
Last time I checked, the list was a _lot_ faster than searching every item alone.
| [reply] |