http://www.perlmonks.org?node_id=618643


in reply to regex help

(.+)? and (.+) works same in your case, because (.+) forms a greedy pattern first and which nullifies the presence of ?