[Tutor] really basic py/regex

bruce badouglas at gmail.com
Fri Mar 30 14:00:13 EDT 2018


Hi.

Trying to quickly get the re.match(....)  to extract the groups from the string.

x="MATH 59900/40 [47490] - THE "

The regex has to return MATH, 59900, 40,, and 47490

d=re.match(r'(\D+)...) gets the MATH...

But I can't see (yet) how to get the rest of what I need...

Pointers would be useful.

Thanks


More information about the Tutor mailing list