regular expression pattern ?

  • Thread starter Thread starter Jon Paal
  • Start date Start date
J

Jon Paal

need pattern to determine if value is an integer (0-9 digits only) > 0

Regex.IsMatch(<Input>, "????")
 
Jon Paal said:
need pattern to determine if value is an integer (0-9 digits only) > 0

Regex.IsMatch(<Input>, "????")

"^\d*$" or "^[0-9]*$".
 
Jon Paal said:
need pattern to determine if value is an integer (0-9 digits only) > 0

Regex.IsMatch(<Input>, "????")

"^\d*$" or "^[0-9]*$".

Or possibly "^\d+$". "^\d*$" will match an empty string, which probably
isn't a valid integer, depending on context.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top