Accept '_' in identifiers and use a constant to store the pattern

This was discovered when trying to delete a Chef credentials resource
named 'hosted_chef'.