-3

[01]?\d{1,2} can someone please explain the complete meaning of the above line.

Joakim Danielson
  • 29,280
  • 4
  • 14
  • 35

2 Answers2

0

This pattern describes a text that might (but not must) start with a 0 or 1 ([01]?) followed by one to two digits (\d{1,2}).

Milgo
  • 2,090
  • 3
  • 14
  • 28
0

In short, this pattern used to test a number between 000 and 199. [01]? means a number starts with 0 or 1, and \d{1,2} means a one-digit or two-digit number.

Oliver.bi
  • 21
  • 1