I have some textual file with source code that contains object.<attribute>, where <attribute> can be an array, for example object.SIZE_OF_IMAGE[0], or a simple string. I want to use a regular expression in Vim to find all occurrences of object.<attribute> and replace them with self.<attribute_lowercase>, in which <attribute_lowercase> is the lowercase version of <attribute>.
I can use :%s/object.*/self./gc and perform the replacement manually, but it is very slow.
Here are some examples of the desired outcomes:
object.SIZEbecomesself.sizeobject.SIZE_OF_IMAGE[0]becomesself.size_of_image[0]