I have the following string:
The Wild won 2 – 1 over the Flames.
I need to extract the team names and the scores from that string. In Python I did the following:
foo = re.findall(r'The (\w+) won (\d+) - (\d+) over the (\w+)\.', mystring)
Now the problem is, there are team names with whitespace in it like this:
The Red Wings won 4 – 3 over the Blue Jackets.
How would I go about writing a regexp that matches both of those string?
You can just edit your original regex to include spaces in the team name groups: