RegEx Find and replace: Replace with found string


I’m hoping this is achievable in Komodo:

I have a RegEx search strategy which looks like this: ^\d{4}\t

I.e. search for lines beginning with 4 digits followed by a tab for which I would like to replace with those same 4 digits that were found but also adding “.00” to the end of those 4 digits.

I don’t know how in the “Replace with:” entry box to enter something that it recognise the need to replace with what was found?

Is this possible?

@Jignesh_Sutar the search and replace uses a Python engine, so for using the found results in the replace value you will have to use \1 syntax. I currently have a issue open so it will also support the $1 syntax.

You have to “remember” the found digits as well.

So you’ll want something like this ^(\d{4})\t. Note the () around your 4 digit selector.

I recommend you give the Regex toolkit a shot so you can try out what @babobski and I have shared here.

  • Carey