Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: positive integer identification (regular expression question)

by CukiMnstr (Deacon)
on Feb 06, 2003 at 21:21 UTC ( #233277=note: print w/replies, xml ) Need Help??


in reply to positive integer identification (regular expression question)

I want to adapt this to identify $ref as a negative integer.

then you want:

($ref =~ /^-[1-9]\d*$/)
(i.e. change !~ to =~)

hope this helps,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://233277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2020-02-24 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (104 votes). Check out past polls.

    Notices?