At the time of the Anglo-Boer War each regiment or corps (Artillery, Engineers etc.) maintained their own numbering system.
With the re-organistion of numbered regiments into territorial named regiments in 1881 numbering began at 1 again. By 1899 all the regiments were using 4 figure numbers, the corps went into 5 figure numbers. Occassionally you see 2 and 3 figure numbers.
Militia regiments followed the same pattern. Men from volunteer battalions were given numbers from the regular battalions as they were specially enlisted into the regular battalion for one year's service.
Numbering in colonial units generally started at 1. At some stage in the war South African colonial units were re-numbered with 5 and 6 figure numbers, so you see a man with perhaps a 2 digit number and then a 6 figure number for the same unit. I don't know how, why or when this took place.
Researcher. Owner: The Register of the Anglo-Boer War 1899-1902. Interests: 24th Foot/South Wales Borderers/RRW/RW. South Africa generally. War memorials