r1 = re.compile('(?<!\\<tr\\>)\\<td', re.IGNORECASE)
r2 = re.compile('\\<\\/tr>', re.IGNORECASE)
test = '<table> <tr><td>1<td>2<td>3</tr> <tr><td>1<td>2<td>3</tr> </table>'
Using Beautiful Soup for HTML tables that lack </td> tags