This is something that is really best done with a mix of regular expression and coded logic. A pure regex solution is pretty much impossible.
So for a quick example, I'll use application I wrote called Rummage to illustrate the logic. First, we would use this pattern:
And use a little Python code:
from rummage.lib import rumcore
def replace(self, m):
return m.group(1) + m.group(2).replace(' ', ' ')
And you can see the results:
Essentially you can put similar logic in a script and make the changes. Or use something like the plugin RegReplace and apply it to your files. Often if I'm making changes across multiple files, I'll use Rummage as it will crawl folders and such, and I don't have to rewrite all that logic. But I'm sure there are other things out there that you can use that can do the same thing.