Using Vim, Notepad++, or Sublime I'd like to be able to search and replace portions of a match. I think this could be done using negative lookahead but I'd like to solicit views from the community.
Say I want to replace incidents of "fall out" with "fallout" in the following examples:
- They are worried about nuclear fall out and radiation.
- There's fall out, and then there's radiation.
- In Nagasaki one of the biggest concerns was fall out.
- One of the best games of the 2000s was "fall out".
A counter example:
- That would fall outside of your purview.
I suppose one obvious pattern to match is:
fall out[^a-z]
But replacing matches with "fallout" here with this match would have undesirable effects, i.e. the comma, space, period, and trailing quote in the four positive examples would be erased.
How do folks typically handle this, and bonus, how would you preserve upper and lower casing in the match?