in reply to Re^3: Matching data against non-consecutive range
in thread Matching data against non-consecutive range

Have you benchmarked it? I haven't... it might not be that bad, and it's most likely a lot better than just
$re = join '|', @list;
anyway...

I could try and optimize it a little by making sure it doesn't even attempt to match if it doesn't see a digit:

/\b(?=\d)$re\b/o

Ideally, I'd think this would be an excellent problem to solve using a regexp assertion in perl code, thus matching all digits first and then testing if it's within range with a hash, all inside the regexp — if only assertions weren't that hard to implement.

p.s. grinder has yet another alternative solution to using Regex::PreSuf, it's currently up on his scratchpad, but for some otherwise noble but in this case silly reason of policy (because he frontpaged the thread) he doesn't dare to post it. Please urge him to post it, it'd be a waste to the site if he didn't. He won't listen to me. :)