0

For example function(null,null,10), How to change to function(null,10,10)? I used

%s/(function(null,)null/\110

to achieve the same, I want to know more abstract method that can replace the second to any number

dlmeetei
  • 9,905
  • 3
  • 31
  • 38
dalihao
  • 3
  • 2

2 Answers2

1

You can do it like this:

:%s/\(\zsnull.\{-}\)\{2}/REPLACE/

https://stackoverflow.com/a/45901621/2541070

caimaoy
  • 1,148
  • 1
  • 11
  • 25
0

This line will change the 2nd parameter into 10, without checking if the first parameter is null or something else. (You didn't ask for that in your question):

s/function(\S*,\zs[^,]*\ze,/10/
Kent
  • 189,393
  • 32
  • 233
  • 301