in reply to (german) region code detection - request for thoughts

[1-9] is not an optimization over [123456789]. Internally, they are the same, the range form is just there for the benefit of the programmer.

As for optimizing it, the best thing you could do is to use perl 5.10. That will have anything you're trying to do by hand build in in the regular expression engine. In 5.10, matching /04105|04106|04107/ is as fast as matching /0410[5-7]/.

Replies are listed 'Best First'.
Re^2: (german) region code detection - request for thoughts
by Anonymous Monk on Aug 20, 2008 at 04:40 UTC
    benefit of programmer hands (so they get sore from other things)