x <- c(
  water            = "7732-18-5",
  d_glucose        = "50-99-7",
  l_glucose        = "921-60-8",
  no_hyphens       = "7732185",
  two_check_digits = "7732-18-55",
  bad_check_digit  = "7732-18-4",
  missing          = NA
)
is_cas_number(x)
assert_any_are_cas_numbers(x)
#These examples should fail.
dont_stop(assert_all_are_cas_numbers(x))Run the code above in your browser using DataLab