CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
\d*

 



emelin
stranger

Feb 22, 2001, 4:25 AM

Post #1 of 2 (987 views)
\d* Can't Post

Doesn't "\d*" mean "any number, at least 0 times"?
I want the user to enter something like P651... my code lets them enter PJJJ (i.e. anything, as long as it has a p or P in it)... How do I just let them enter PXXX, X being a number?

if ($FORM::part =~ /P\d*/i){
continue();
}

thankful for help,
emelin



japhy
Enthusiast

Feb 22, 2001, 7:30 AM

Post #2 of 2 (985 views)
Re: \d* [In reply to] Can't Post

The regex \d* means 0 or more digits (0-9). This matches on the string "japhy". Do you see where? Right at the beginning of the string. I can see 0 digits there, and that's what I asked to match.

Perhaps you meant \d+. Or, more specifically, \d{3}.

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives