Reuse code from Sanitizer to check if metric key is regexp or normal string