Nov-24-2018, 03:14 AM
When I try to assign the regex expression I search for to a variable, I get this:
I thought I could just get the student number directly. Not so it seems.
What is the best way to get the actual student number, in this case 1825010243 out of there as a variable?
Quote:>>> studentnrRegex = re.compile(r'(18\d\d\d\d\d\d\d\d)')
>>> studentnr = studentnrRegex.search(text)
>>> studentnr
<_sre.SRE_Match object; span=(2071, 2081), match='1825010243'>
I thought I could just get the student number directly. Not so it seems.
What is the best way to get the actual student number, in this case 1825010243 out of there as a variable?