Improved regex which cleans up single inheritance keys from special chars