Number::Range::Regex

Create regular expressions that check for integers in a given range
Download

Number::Range::Regex Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Brian Szymanski
  • Publisher web site:
  • http://search.cpan.org/~brianski/XML-Comma-1.998/lib/XML/Comma/docs/faq.pod

Number::Range::Regex Tags


Number::Range::Regex Description

Number::Range::Regex is a Perl module to create regular expressions that check for integers in a given range.which is more legible - this? $date =~ m/^0*(?:||3)\/0*(?:|1)$/;or this? my $day_range = regex_range(1, 31); my $month_range = regex_range(1, 12); $date =~ m/^$day_range\/$month_range$/;(bonus points if you spotted the bug)SYNOPSIS use Number::Range::Regex; my $range = regex_range( 15, 3210 ); if( $jibberish =~ /$range/ ) { print "your jibberish contains an integer between 15 and 3210"; } if( $num =~ /^$range$/ ) { print "$num is an integer between 15 and 3210"; } if( $line =~ /^\S+\s+$range\s/ ) { print "the second field is an integer between 15 and 3210"; } my $octet = regex_range(0, 255); my $ip4_match = qr/^$octet\.$octet\.$octet\.$octet$/; my $range_96_to_127 = regex_range(96, 127); my $my_slash26_match = qr/^192\.168\.42\.$range_96_to_127$/; my $my_slash19_match = qr/^192\.168\.$range_96_to_127\.$octet$/;Product's homepage


Number::Range::Regex Related Software