Monthly Archives: February 2013

Using RegEx to replace HTML Tags

This regular expression matches the html italic begin and end tags as well as any text between them:
 <i>([^<]+)</i>

This regular expression will replace the found italic tags with beginning and end span tags of class ‘caseName’:
<span class=”caseName”>1</span>

The 1 represents the first group in the find expression (between the parenthesis), thus preserving the text between the tags. This may be unique to the regex in Notepad++. Other regex tools may use $1 instead.

Source: http://stackoverflow.com/questions/3218063/notepad-replace-problem