Optimize performance - avoid QRegExp

Use string searching wherever possible instead of constructing temporary
regular expressions, and if a regexp is required, use QRegularExpression
instead.

These changes reduce loading time from ~3.5 seconds to ~2.3 seconds.