in reply to Range of numbers

You can abuse Regex::Assemble for this:
use Regexp::Assemble; $re = Regexp::Assemble ->new() ->add( 250..730 ) ->re();


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Range of numbers
by ikegami (Patriarch) on Oct 10, 2008 at 12:49 UTC
    Regexp::List (from the same distro) is the appropriate choice when the inputs are text strings (as opposed to regexp patterns).
    use Regexp::List qw( ); my $re = Regexp::List->new()->list2re( 250..730 );

    In Perl 5.10, the regexp engine already does that for you.

    use 5.010; # Trie alternations my ($re) = map qr/$_/, join '|', #map quotemeta, # Not needed this time. 250..730;