In Vim, how to replace a string corresponding to a certain regular expression with its length, for example:
Regexp = "\ w *"hello β 5"bye" β "3"
Regexp = "\ w *"
hello β 5"bye" β "3"
Can this be done with: s or do I need to write some script?
Best wishes
Replace 'hello' with a regex expression expression, and this should work in VIM:
:s/hello/\=strlen(submatch(0))/
Source: https://habr.com/ru/post/885398/More articles:Create a list in an Android application - androidUsing personal SSL certificates using Webdriver (Selenium 2.0) - javaPassing some LINQ query into function argument? - c #Count the various lines in C # code - stringHow to create a DateTime object? - c #Search SQL test suite generator, ideally open source - sqlPlaying back Ruby OpenSSL private_encrypt output in C # - c #Set f: parameter value using JavaScript - javaNumber of samples in the series Exceedence - c #How can I link to another project in Eclipse Java EE projects? - eclipseAll Articles