Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Check for a valid Chemical Abstracts Service (CAS) Registry Number
ResourceFunction["ValidCASNumberQ"][s] checks if s is a valid Chemical Abstracts Service (CAS) Registry Number. |
The CAS number for aspirin:
In[1]:= |
Out[1]= |
Check that this result is a valid CAS number:
In[2]:= |
Out[2]= |
When supplied to ValidCASNumberQ as a String, the CAS number may or may not have hyphens:
In[3]:= |
Out[3]= |
In[4]:= |
Out[4]= |
ValidCASNumberQ also accepts Integer arguments:
In[5]:= |
Out[5]= |
ValidCASNumberQ can be used on ExternalIdentifier objects:
In[6]:= |
Out[6]= |
ValidCASNumberQ returns False for everything else:
In[7]:= |
Out[7]= |
In[8]:= |
Out[8]= |
This work is licensed under a Creative Commons Attribution 4.0 International License