Sublime Text 2 RegEx replace n with n+1

2019-06-23 06:16发布

Using RegEx search and replace with Sublime Text 2, how can I replace my pattern matches (n) with n+1? And if there is no way to do this with search and replace, is there another easy way to do it?

My RegEx pattern is ^(\d{1,4})\n, and I'd like to be able to do $1+1, which currently just outputs the match with a literal "+1".

1条回答
欢心
2楼-- · 2019-06-23 06:31

Regex is the wrong tool for that function. However, there is Sublime Text plugin just to do what you want: "Sublime Text plugin to increment/decrement all selected numbers"

查看更多
登录 后发表回答