\'? at the beginning and at the end means with greed 0 or 1 apostrophes. (As another poster pointed out, in order to make it inanimate, it must be \'?? )
.*? in the middle means matching 0 or more characters without greed.
Perl's regex engine will look at the first part of a line. He will be consistent with the beginning, but he does it with greed, so he raises the first apostrophe. Then it corresponds to not greedy (as little as possible is required), and then an optional apostrophe. This corresponds to an empty string.
source share