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

Re: Re: specific numbers of digits

by awkmonk (Monk)
on Mar 19, 2003 at 14:30 UTC ( #244342=note: print w/ replies, xml ) Need Help??


in reply to Re: specific numbers of digits
in thread specific numbers of digits

Sorry to point this out, but..

$x = "123456"; if ( $x =~ /\d{5,5}/ ) { print "wrong"; }

Still matches 123456

This will do the trick

$x = "123456"; if ( $x =~ /^\d{5}$/ ) { print "right"; }


Comment on Re: Re: specific numbers of digits
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-08-30 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (348 votes), past polls