You can use regular expression to find all the matches, like this:
from re import findall def hashnumbers(string): return findall(r'd+', string) hashnumbers("abc123 456def g789h")
1.4m articles
1.4m replys
5 comments
56.9k users