Port getVersionFromString away from QRegExp
(cherry picked from commit c5383f3385a395ab72093379d8e60c2c89cfee33)