Avoid perl warnings

perl 5.20 warns "Useless use of greediness modifier ? in regex" when a question mark is used after a quantifier, but the whole thing is followed by the \z anchor.