6

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".

BenjaminRH
  • 11,974
  • 7
  • 49
  • 76

1 Answers1

7

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"

Andrew Cheong
  • 29,362
  • 15
  • 90
  • 145
  • 1
    My god! Of course there's a plugin! It's simple to create functionality yourself, but if you're feeling lazy or don't know how, there's a plugin. This is starting to feel a bit like Drupal. Only much more awesome. Thanks for the answer! – BenjaminRH Oct 17 '12 at 19:06