Regex for range of numbers

deskcheck1-0579 411 Reputation points
2021-01-23T17:29:03.83+00:00

Hi, What is the regular expression pattern that matches: All negative whole numbers and all positive whole numbers with range 0 to 366? Appreciate any help.

Developer technologies Windows Forms
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.5K Reputation points
    2021-01-23T19:02:54.087+00:00

    Check this expression:

    ^(+|-)?([0-9]|[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6])$

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.