Fix regular expression to work with multiple-digit version numbers

Propose to cherry-pick this commit into mono4 branch. bockbuild is broken right now and needs this commit.