S
Scott Sauyet
I said:The idea is to work recursively with ranges that have both a start and
an end, with a tree structure for, say 267 - 4301, of
267-4301
+- 267-999
| +- 267-299
| | +- 267-269: 26[7-9]
| | `- 270-299: 2[7-9]\d
| `- 300-999: [3-9]\d\d
`- 1000-4301
+- 1000-3999: [1-3]\d\d\d
`- 4000-4301
+- 4000-4299: 4[0-2]\d\d
`- 4300-4301: 43[0-1]
That last line should read 4300-4301: 430[0-1].
-- Scott