I'm using replaceAll() on a string to replace any letter with "[two letters]". So xxxaxxx to xxx[ab]xxx. I don't want the ones that have already been replaced to be done again (turns to xxx[a[cb]]xxx)...
An easy way to do this would be to exclude any letters that are proceded by a "[" or followed by "]". What's the correct Regex to use?
replaceAll(foofoofoo, "[ab]");