There are numerous variants on the problem, but a couple examples should suffice for an initial discussion.
Suppose the source document has
**this should be bold**
and I want to replace it with
\textbf{this should be bold}.
So I want to enter a regular expression that copies the content between the bracketing ** ... ** and replaces the entire string with \textbf{ ... }.
As a second example, I want to replace
### subsection title \n
with
\subsection*{subsection title} \n.
Are these doable using Kate?