Wednesday, March 2, 2016

XSD string pattern

Today I have come across a generated piece of XSD definition and it's restricted with a specific pattern

(0[4-9])|(1[0-9])|(2[0-6])

It puzzled me for a little time, and found the answer after little bit of testing.   What it means is any value within 04 - 26 is a valid value.

(0[4-9])    Any digit between 4 to 9 prefixed by zero
|  or
(1[0-9])    Any digit between 0 to 9 prefixed by one
| or
(2[0-6])    Any digit between 0 to 6 prefixed by two


No comments: