Конечно, требуется много шагов, но это должно сработать:
(?<=^000)[^0].{8}|(?<=^0000).{8}
(?<= 'start lookbehind
^000 'for the beginning of the string then three zeroes
) 'end lookbehind
[^0] 'match a non-zero
.{8} 'match the remaining 8 chars
| ' OR
(?<= 'start lookbehind
^0000 'for the beginning of the string then four zeroes
) 'end lookbehind
.{8} 'match the remaining 8 chars
Тем не менее, в. NET, это будет быстрее сделать:
dim trimmed = line.TrimStart("0"c)
dim numberString = trimmed.Substring(0,trimmed.Length-2)
если формат этих строк всегда один и тот же