if you can use non-greedy quantifiers,
replace \\textbf\{(.*?)\} with \1
Ok, as Werner mentioned, this only works with non-nested commands.
I think, there is no simple solution for this and it's a parser job.
If you want to do it anyway with Regex, you could replace the non-\textbf-brackets with a non-used symbol, and at then end remove the \textbf-brackets and change the symbols back to brackets:
1) Replace all closing non-\textbf-brackets } with Symbol A,
2) Replace all opening non-\textbf-brackets { with Symbol B,
3) Replace the remaining \textbf{ and } (from \textbf) with nothing,
4) Replace Symbol A with { and Symbol B with }
@Step 1 and 2:
Step 1: } -> Smybol A, in my example german ö:
(?<=(?<!\\textbf)\{(?!.*?\{)).*?\}
Replace this expression with \1ö (I didn't found a better solution for this expression)
Then do Step 2: { -> Symbol B, in my example german ä
(?<!\\textbf)\{(?!.*?\{)
Replace this expression with ä.
Redo these steps as many nested levels you have. Then follow the remaining steps.
Well, this is more a regex-macro and a workaround than a solid regex, but it should work.
\let\textbf\relaxto your document preamble if you want to remove the functionality of\textbfaltogether. You can then leave\textbfin your document and it will have no effect. – Werner Mar 24 '14 at 20:14\def\textbf#1{#1}. – Malipivo Mar 24 '14 at 20:24\let\texbf\@firstofone– egreg Mar 24 '14 at 20:46\textbf{...}define a macro say\important. That way, if at a later stage you want to change how the output looks, you can just redefine the macro\important. – Aditya Mar 24 '14 at 21:12Then there's a system to clear my file quicly with a regular expression that understand when finish a determinate gruop? Or i need delete all \textbf and after find all { } not necessary manually?
THX all again
Vitaliano
– user48106 Mar 25 '14 at 10:22\newcommand{\notbold}[1]{#1}and change all your\textbf{s to s\notbold{s (you don't even need regex)? This then doesn't wipe out\textbf` in case you need it again. – Chris H Mar 25 '14 at 11:32