in reply to Re: Regexp for range of numbers
in thread Regexp for range of numbers
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { chomp; printf "%d %s\n", $_, /^(\d{1,3})${\($1 > 255 ? qr(^) : qr($))}/ ? "matches" : "fails"; } __DATA__ 3 100 333 200 Use of uninitialized value in numeric gt (>) at XXX line 9, <DATA> lin +e 1. 3 matches 100 matches 333 matches 200 fails
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regexp for range of numbers
by Roy Johnson (Monsignor) on Apr 05, 2005 at 12:55 UTC | |
by Anonymous Monk on Apr 05, 2005 at 14:38 UTC | |
by Roy Johnson (Monsignor) on Apr 05, 2005 at 15:26 UTC |