Finding occurence of every digit or word in a given string or number