For example we use re.findall()

import re

# A sample text string where regular expression
# is searched
string = """Hello my student id is 923472387 and 
						my friend's number student id is 234130324"""

# A sample regular expression to find digits.
regex = '\\d+'

match = re.findall(regex, string)
print(match)
['923472387', '234130324']

re.findall( ) : return all suitability pattern that is not overlap into string, as string list. String is scanned from left to right, and the suitability is returned in the list that has been founded.