Q:

Problems with basic python syntax for regular expressions

I'm studying for a bio-informatics exam but there are some things my professor did that i just don't understand. I've tried looking it up but can someone please explain this in a non-programmer language? I really have tried looking things up to understand but i'm just a bit clueless.My questions are about this;
import re
line = "Cats are smarter than dogs"
matchObj = re.match(r'(.*) are (.*?)*',line,re.M|re.I)

if matchObj:
  print("matchObj.group():",matchObj.group())
  print("matchObj.group():",matchObj.group(1))
  print("matchObj.group():",matchObj.group(2))

My questions:

what does the (.*) do, i'm guessing you're trying to match 'cats' but then why don't you just type cats? I understand that . means 'any character' but i don't understand what * does
What does the combination (.?)' do?
What does re.M|re.I do?

Thanks so mutch! I'm starting to become a bit desperate. My mind just doesn't work in the right way to understand this kind of things i think.

A:

i'll give you the first one, these are are actually as easy as regex you will ever see out there in the wild :) 
. is any character
* is unlimited times
so...
(.*) is any character unlimited times
here is the link to python docs on regular expressions https://docs.python.org/2/library/re.html... You can easily look up each character. Try one and post back here with your questions if you get stuck :)

