I want to count all NumberStrings in a list:
In[1]:= myList = {"123", "456", "789", "ab1", "cd2", "xyz"}; but, surprising (to me), I have to take a detour here:
In[2]:= Count[myList, NumberString] Out[2]= 0 by using this explicit pattern specification:
In[3]:= Count[myList, _?(StringMatchQ[#, NumberString]&)] Out[3]= 3 Any comments?