Replacing dashes and underscores within generated key with alphanumeric characters