0

How do I replace every number n that matches a certain pattern with n+1 in VsCode?

E.g.

1,2,3,4,5,6,

Result.

2,3,4,5,6,7,
Ulysse BN
  • 10,116
  • 7
  • 54
  • 82
George Lin
  • 13
  • 6

1 Answers1

0

TL;DR: Regex doesn't look like the appropriate tool.


However, some regular expressions engine allow it, such as vim's one:

s/<\zs\d\+\ze>/\=(submatch(0)+1)/g

And in sublime text there is a plugin for that: https://stackoverflow.com/a/12940856/6320039

This said you could either use vim only for this task or help the community by creating a new plugin similar to the above example!

Ulysse BN
  • 10,116
  • 7
  • 54
  • 82