Using the match count as replacement text?
Submitted by Thursday, 21 October, 2010 - 20:36
on
I have searched... uh... literally for at least a year on and off for a solution to this.
What I need to do is to "count" matches and use the "count" number as part of the replacement. I am attempting to change the formatting of a 3d file to another 3D application. Some elements that are not numbered in the original format need to be numbered in the target format. The only way I see to do this is with a macro that can track the match count.
I am very familiar and proficient with regex in jEdit but not so hot with writing macros or java programming. Just looking for some kind of "loop" structure in a macro that counts the matches and increments a variable to be inserted on each match/replace.
What I need to do is to "count" matches and use the "count" number as part of the replacement. I am attempting to change the formatting of a 3d file to another 3D application. Some elements that are not numbered in the original format need to be numbered in the target format. The only way I see to do this is with a macro that can track the match count.
I am very familiar and proficient with regex in jEdit but not so hot with writing macros or java programming. Just looking for some kind of "loop" structure in a macro that counts the matches and increments a variable to be inserted on each match/replace.