Loading ...
Sorry, an error occurred while loading the content.

4406Can a RegExp replace handle incrementing a number?

Expand Messages
  • kraemz
    Jan 9, 2006

      I have several XML files that I update regularly, which contain ID
      numbers in the format:


      I can easily isolate these instances with the regular expression:


      I need to keep the id= and the quotes, and replace only the numeric
      portion (\2). The challenge is that I need to increment this number
      by 1 during the replace. So in the example, the result of the replace
      would be:


      I can't find any way to do this. Is it even possible, and if so, how?
      Right now I'm just searching with a RegExp similar to the above (but
      without the tagged expressions), and then double-clicking the number,
      and typing in the new value. But when there can be over 100
      replacements each time, it gets tedious fast. There's got to be a way
      around this.

      Any suggestions would be appreciated.

    • Show all 8 messages in this topic