if you are using regexes, you should capture the hours, minutes, and seconds inside the regex itself.   http://qt-project.org/doc/qt-4.8/qregexp.html#capturing-text