I have managed to create a command that takes an argument and does substitutions on it with l3regex. However, if the argument contains itself a command, the command name is printed in the output as if it was a string.
\documentclass{article}
\usepackage{l3regex}
\ExplSyntaxOn
\newcommand\mycommand[1]{
\str_set:Nn \l_temp_str {#1}
\regex_replace_all:nnN {[abc]} {\c{textbf}\cB\{\0\cE\}} \l_temp_str
{\l_temp_str}
}
\ExplSyntaxOff
\begin{document}
\mycommand{wax\textit{b}ycz}
\end{document}
How should I correct the code so that the argument string can include any command?