In a file with something like:
self.phrase
self.phrases
self.phrase.lower()
self.phrase_lowered
self.phrases[self.phrase]
I'd like to replace all self.phrase
with self._phrase
, except for self.phrases
to get:
self._phrase
self.phrases
self._phrase.lower()
self._phrase_lowered
self.phrases[self._phrase]
Of the regexes I've tried, the first (and one I thought would work) was:
:%s/self\.phrase[^s]/self\._phrase\1/gc
But it didn't work.