Microsoft has built in functions for this:
someString = someString.PadLeft(8, '0');
And here's an article on MSDN
To use a regular expression, do something like this:
string someText = "asd 123 rete";
someText = Regex.Replace(someText, @"d+", n => n.Value.PadLeft(8, '0'));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…