Some argument validation for the grep method.