There's no reason to post your code on a separate website - include it in your post (as I have done above) and be sure to wrap it with the board's [noparse]
...
[/noparse] bbcode tags.
As for the replacement, one way to do it would be to use the 'e' modifier on your pattern so that the replacement string is evaluated as PHP code; that would allow you to use something like:
'str_replace("0", "1", "$0")'
as the replacement instead.
EDIT: By the way, I suspect that your regexp pattern isn't what you're after either. It's still going to do a replacement if you have five 0's in a row, since five 0's in a row also means you have 4 of them in a row (which will get replaced).
Instead, you should probably add a negative lookahead and lookbehind to make sure that there isn't a zero to the left or to the right of the matched pattern.