October 15, 2014

Find and Duplicate with Regex in Notepad++

In order to duplicate a text (instead of find and replace, find and duplicate) use regex feature provided with Notepad++ as follows.

Assume the following content in an XML :
 <person firstname="ann" /> 
Now lets convert this to following :
<person firstname="ann" nickname="ann"/>
So to do the above you need to do as below.
  • Go to Find and Replace window
  • In Find text enter : firstname="(.*)"
  • In Replace with text enter : firstname="\1" nickname="\1"


No comments:

Post a Comment