-3

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

Joakim Danielson
  • 35,353
  • 5
  • 20
  • 45

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,399
  • 3
  • 20
  • 35
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