In modern versions of Perl, you can force nongreedy, minimal matching by placing a question mark after any quantifier.