in reply to Re^2: Alternative matches
in thread Alternative matches

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.

Replies are listed 'Best First'.
Re^4: Alternative matches
by kiat (Vicar) on Oct 06, 2004 at 09:44 UTC
    Thanks, gaal! I get the idea now :)