Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Eclipse Find/Replace-field can i alter the regexp-matched result $1?

I want to search and replace a lot of numbers in the range 0-9 and add one to them, so they become in the range 1-10 instead.

for example: 0 3 5

would become: 1 4 6

In eclipse Find/Replace window I can match a number with ^([0-9]+)$

In the replace-field can I somehow add to the matched number $1?

/G

like image 857
Geggamojja Avatar asked Sep 11 '25 19:09

Geggamojja


1 Answers

No, there isn't a way to specify a callback function/macro, which is what you would need in order to change the first group ($1), or any of the results, in such a way.


Maybe there's a plugin that will enable this, but I'm not currently aware of one.


As a work-around, you could perhaps use jEdit for this, which does allow you to apply a script to your results (although I've not yet tried it myself so not sure how well it works).

like image 107
Peter Boughton Avatar answered Sep 13 '25 08:09

Peter Boughton