by skulk · 2y ago · 0 comments
:%s/\([0-9]+\))/\,(1- \#1))/
will turn 1) one
2) two
3) three
into 0) one
1) two
2) three :%s/\([0-9]\+\))/\=submatch(1)-1.')' " vim
perl -pe 's/([0-9]+)\)/$1-1 .")"/e'
ruby -pe 'sub(/([0-9]+)\)/){"#{$1.to_i-1})"}'