Hi.
Geany is limited to 9 groups in regular expressions. If you try to use a group after the 10th, it is replaced with the first group and the second digit of the group number. For example, if the group 1 is "first" and the 10 group is "tenth", \10 is replaced as "first0".
Greetings.
The POSIX regular expression language specifies only a single digit for the backreference number so the limit for numbered backreferences is nine. Use named backreferences instead, see https://developer.gnome.org/glib/stable/glib-regex-syntax.html "named subpatterns"
Postscript, it seems that substitution of named captures in replacement strings is not supported http://www.geany.org/manual/current/index.html#regular-expressions, so you could raise a feature request for that.