I have to change strings:
fetchrandomData
tofetchReportingData
FETCH_RANDOM_DATA
toFETCH_REPORTING_DATA
I can change ca_z
and CA_Z
to ca_t
and CA_T
respectively with command:
%s/\v([Cc])([Az])(_)?([Tt])/\1\2\3\4/gci
.
For a string with 3 or more characters this method seems unfeasible, let alone for string FETCH_RANDOM_DATA
of length 17 characters.
What is more a feasible way to do something like this in vim?
r
inrandom
in your first example still lowercase deliberately?s/\vfetch(_)?random(\1)?/fetch\1Reporting\1/gci
, I end up withfetch_Reporting_DATA
forFETCH_RANDOM_DATA
. The first examplefetchrandomData
is replaced successfully withfetchReportingData