Please remember that regex will not only match characters, but also produce 0-length matches.
(0*)(\d*)
in fact works, it's just that it matches the stuff you want plus some empty matches:
[ '', '', '', '', '00023546546', '' ]
See those 0-length matches?
Now I'll explain why those 0-length matches are there. Your regex says that there should be 0 or more 0
s, followed by 0 or more digits. This means that it can match 0 0
s and 0 digits, doesn't it? So the space between every character is matched because that "substring" has exactly 0 0
s and 0 digits!
By the way (0*)(\d*$)
will only work if the match is at the end of the string.