Added support for captures in regexp replacement (\1-\9).
Fix spurious replacement after 'search, clear selection, replace' actions.
Switched to using POSIX compatible regexp with '()' used for captures.