check_format function

Check that an argument is a valid format specification