Avoid unexpected `RegExp#test` behavior

For global regular expressions (i.e. if the `g` flag is used), `RegExp.prototype.test` updates the regular expression object’s `lastIndex` property so that each test starts where the last one stopped. See http://mths.be/bnj for details.

This behavior caused a bug in situations where `stringEscape` was called more than once on strings containing `\0` followed by a non-digit symbol.

As a workaround, `String.prototype.match` could be used, but in this case the fix is even simpler: the `regexDigit` regular expression doesn’t need the `g` flag. Removing the `g` flag successfully avoids the issue.