Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Could a blessed monk point out my folly please? Thanks for all the replies to my previous question (esp. dws) and TIA for this one. Jono#!/usr/bin/perl while (<>) { print if m!(^-{0,1}\d*)\s+(\d*)!m; print "$_\n" for ($1 .. $2); } But when I allow both to be negative it doesn't: #!/usr/bin/perl while (<>) { print if m!(^-{0,1}\d*)\s+(^-{0,1}\d*)!m; print "$_\n" for ($1 .. $2); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex negative numbers
by bjelli (Pilgrim) on Aug 28, 2002 at 08:13 UTC | |
|
Re: regex negative numbers
by theorbtwo (Prior) on Aug 28, 2002 at 06:50 UTC | |
|
Re: regex negative numbers
by hotshot (Prior) on Aug 28, 2002 at 06:37 UTC | |
|
Re: regex negative numbers
by Django (Pilgrim) on Aug 28, 2002 at 06:51 UTC |