replace [noparse]/#b([\w ])#k/ with /\Q\E\1\Q/.[/noparse]
Does Python have a substitution function?
sed/anything similar =[noparse]s/#b([\w ])#k/\Q\E\1\Q/g;[/noparse]
Actually I guess that should be [noparse]s:#b(.*?)#k:\1:g[/noparse] which looks much nicer.
Explanation: \Q starts a literal string, \E ends it. When you place a segment of a regex in parentheses it gets stored in the buffers \1..\9.
Does Python have a substitution function?
sed/anything similar =
Actually I guess that should be [noparse]s:#b(.*?)#k:\1:g[/noparse] which looks much nicer.
Explanation: \Q starts a literal string, \E ends it. When you place a segment of a regex in parentheses it gets stored in the buffers \1..\9.

