If this were my URLs, and assuming ID 2 and 3 are always two digits, I would make the variable-length number the last item, not the first. The pattern is then
([0-9]{2})([0-9]{2})([0-9]{1,3})
and can be read in one pass (for ID 3, 2, 1 in that order).
However, going with your way for a moment, if the second and third ID are always two digits, you can use
([0-9]{1,3})([0-9]{2})([0-9]{2})
or something similar.
If the other parts are also variable in length this is unsolvable without adding separators. The preceding pattern isn't very efficient, needing several back off and retry attempts before a match might be found. The alternative is to test the number length first and have three separate rules to split it up.
First rule tests
^[0-9]{7}$
and then
([0-9]{3})([0-9]{2})([0-9]{2})
in a RewriteCond.
Second rule tests
^[0-9]{6}$
and then
([0-9]{2})([0-9]{2})([0-9]{2})
in a RewriteCond.
Third rule tests
^[0-9]{5}$
and then
([0-9]{1})([0-9]{2})([0-9]{2})
in a RewriteCond.
The RewriteCond will generate the %1, %2 and %3 backreferences for later use.
The above assumes that ID 2 and 3 are always two digits.
If those IDs are also variable in length this is unsolvable without adding separators, or without using a leading zero. My way to solve this would be to make sure that all references are exactly seven digits, using leading zeroes where appropriate.
The pattern is then simply
^([0-9]{3})([0-9]{2})([0-9]{2})$
At present it is impossible to tell whether 123456 is 123, 4, 56 or is 123, 45, 6 or is 12, 34, 56. I would use 1230456 and 1234506 and 0123456 to be absolutely sure.