in reply to Re: Matching date range with pure regex
in thread Matching date range with pure regex

By way of explanation, this builds a long regexp through basic string interpolation like the following:
/^(?:1950|1951|1952|1953|...|2049|2050)$/;
After generating a regex like that, if you will be using it often, you might want to optimize it for common prefixes or suffixes.
use Regex::PreSuf; my $re = presuf(1950..2050);

--
[ e d @ h a l l e y . c c ]

Replies are listed 'Best First'.
Re: Matching date range with pure regex
by Abigail-II (Bishop) on Feb 17, 2004 at 13:27 UTC
    If the OP wanted something optimized, he wouldn't have used a regex to begin with.

    Abigail