In CC, we have many other special replacement rules, or some macro definitions which could have other than the chars in
static const wxRegEx reKey(wxT("^[[:alnum:]_]+$"), wxRE_EXTENDED);
See: Code Completion Design - CodeBlocks
So, this is an issue.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.