noggon has asked for the wisdom of the Perl Monks concerning the following question:
I am looking for some wisdom about a regular expression:
($ref !~ /^-?\d*(\.0*)?$/)
Firstly I think that this identifies $ref as an integer (i.e. ref is not equal to a non-integer), that being the case I want to adapt this to identify $ref as a negative integer.
I tried this:
($ref !~ /^-[1-9]\d*$/)
Help appreciated.
Scott
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: positive integer identification (regular expression question)
by clscott (Friar) on Feb 06, 2003 at 20:45 UTC | |
|
Re: positive integer identification (regular expression question)
by PodMaster (Abbot) on Feb 07, 2003 at 06:03 UTC | |
|
Re: positive integer identification (regular expression question)
by Enlil (Parson) on Feb 06, 2003 at 21:24 UTC | |
by noggon (Initiate) on Feb 06, 2003 at 22:06 UTC | |
by CountZero (Bishop) on Feb 06, 2003 at 21:56 UTC | |
by Enlil (Parson) on Feb 06, 2003 at 22:32 UTC | |
by CountZero (Bishop) on Feb 08, 2003 at 19:40 UTC | |
|
Re: positive integer identification (regular expression question)
by CukiMnstr (Deacon) on Feb 06, 2003 at 21:21 UTC |