471,873 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

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 1091
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.