Fix replaceCaptures() to work with more than 9 captures

Authored by dhaumann on Jul 23 2017, 10:47 PM.

Description

Fix replaceCaptures() to work with more than 9 captures

Currently, the for loop iterates from 1...n, which is an issue,
if n > 9. Luckily, this so far was never an issue, since we
typically have only one or two captures in dynamic context rules.

Additionally, the helper function to escape the regexp is
removed in favor of QRegularExpression::escape().

Differential Revision: https://phabricator.kde.org/D6858