Xyzk
Xyzk

Reputation: 1332

regex for replacing html tags with whats between them

Previously webpage had all information stored in html tables, now it is stored in xml files and the tables are dynamically generated.

Now, I have to manually change html files to xml one. I'm trying to create regex which would change

<tr>
    <td>a</td>
    <td>b</td>
</tr>

to

 <a>b</a>

(I'm editing the file in notepad++, and it supposedly supports regex)

Upvotes: 0

Views: 39

Answers (1)

nhahtdh
nhahtdh

Reputation: 56809

Find what:

<tr>\s*<td>(.*?)</td>\s*<td>(.*?)</td>\s*</tr>

Replace with:

<$1>$2</$1>

Please select regular expression mode.

Upvotes: 1

Related Questions