469,331 Members | 1,802 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

Need help with regular expression

1
if ( $report_id = ~ /^\d+$/ )

can anyone tell me what "~ /^\d+$/ " expects and returns true.
Thanks in advance
Sep 19 '06 #1
1 1076
Rykus
5
if ( $report_id = ~ /^\d+$/ )

can anyone tell me what "~ /^\d+$/ " expects and returns true.
Thanks in advance
If $report_id contains one or more digits (\d+) from beginning(^) to end ($)

This will report true if your $report_id is only numerical values from beginning to end (numerical values being 0 through 9)

Fals if it is anything else (ie there is any whitespace, alpha, or special characters)

So 3207283469028 is valid, but 280720a2037 is not

Hope that helps
Sep 20 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Mike Andrews | last post: by
4 posts views Thread by Neri | last post: by
18 posts views Thread by Q. John Chen | last post: by
3 posts views Thread by Lucky | last post: by
17 posts views Thread by Mark | last post: by
14 posts views Thread by Chris | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.