Skip to content

Instantly share code, notes, and snippets.

@ishritam
Created April 22, 2020 21:15
Show Gist options
  • Save ishritam/75b1b39091692351aa6ffbbbf11cef3b to your computer and use it in GitHub Desktop.
Save ishritam/75b1b39091692351aa6ffbbbf11cef3b to your computer and use it in GitHub Desktop.
text = 'Jersey number of Cristiano Ronaldo is 7, his twitter account is @Cristiano. '
patterns=[ r'\d+', # sequence of digits
r'\D+', # sequence of non-digits
r'\s+', # sequence of whitespace
r'\S+', # sequence of non-whitespace
r'\w+', # alphanumeric characters
r'\W+', # non-alphanumeric
]
multi_re_find(patterns,text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment