Is there an easy and elegant way to add characters in a String at specified places around found characters?
The way I started thinking was like this:
String regExp = '[\\d]'; String toFormat = '1 and 2'; String formatted = toFormat.replaceAll(regExp, '[ ]');
Now what happens, is that every numerical character is replaced by '[ ]'. My goal is not to have those characters replaced, but embraced by the bracets:
 and 
Maybe I am not thinking in the right direction at all, does Salesforce offer specific solutions to this?