Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: What does this regex do?

by MrYoya (Monk)
on Apr 01, 2003 at 19:25 UTC ( [id://247322]=note: print w/replies, xml ) Need Help??


in reply to What does this regex do?

/^-?\.?\d+(?:\.\d+)?$/
It means match if there's a - in front or not, followed by an optional . (period), then one or more digits, then optionally a . (period) followed by one or more digits. Since it's anchored at the front and back, that's all it can match. So it matches numbers like
-.5 or 5.5522 or -62.0
Since it's using the !~, it'll match anything but that.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 16:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found