views:

171

answers:

1

In Netbeans the "Replace command"(ctrl+H) has a regular expression checkbox so that i can search and replace in the document using regex's. Also i can replace using a backreference.

The question is can i use a backreference in a calculation and then use it?

For example with the use of "([0-9]{1})" in the "Find what" i will find all the numbers and with the use of "$1a" in the "replace with" results in replacing all numbers with the number itself followed by the letter a.

123456--->1a2a3a4a5a6a

I want to achive replacing 123456 with 234567 so i want to know if i can use something like ($1 +1) in the "replace with" or if there is another way to do this BUT ONLY with regex(not in MS Excel or anything similar)

Thank you

+2  A: 

Simple answer: no, that's not possible.

Bart Kiers