[search addon] Fix replacement of multiple groups

Closes #2268