New answers tagged

6

:%s,\v(\d+)/(\d+)/(\d+),\3/\1/\2,g s is the substitution command, the % before it means that all lines of the file will be considered. , is the separator. It is common to choose / as the separator, but since there are slashes in the pattern and replacement, it is useful to choose another separator, so as to avoid escaping. \v enables very magic mode, so ...


4

To find aid separated from country by at most 3 words, choose one: /aid\(\W\+\w\+\)\{,3}\W\+country /\vaid(\W+\w+){,3}\W+country If words may be separated only by single space characters, it can be further simplified to /\vaid( \w+){,3} country Try it on this minimal, reproducible example: Now is to the aid of their country. Now aid of come their the ...


Top 50 recent answers are included