Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Regex Pattern Problem

by ZZamboni (Curate)
on Feb 28, 2001 at 02:53 UTC ( [id://61216]=note: print w/replies, xml ) Need Help??


in reply to Regex Pattern Problem

I think your logical statement can be restated as "a line made only of digits, at least 5 digits long", and in that case the regular expression you need is
/^\d{5,}$/
You could add a \s* right before the $ if you want to allow for spaces at the end.

Or if you want to allow both digits and spaces, you could use:

/^\d{5,}[\d\s]*$/

--ZZamboni, aka Duke Dong

Log In?
Username:
Password:

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

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

    No recent polls found