graphite: use the official regex to replace illegal characters