0
<td width="16%" height="123" class="adult_normal_text">

<td height="123" width="86%" colspan="2" class="adult_normal_subheader">

<td width="54%" height="123" >

I have three kinds of format < td>,

I want to get rid of "height=123",

And if the presence of class in class behind writing tbdh123

If there is no class add class= "tbdh123".

Thanks

Bullhead
  • 1
  • 1
  • 1

1 Answers1

2

Don't use a RegEx. Use an HTML parser. Since I don't know what language you're using, I can't provide a suggestion but it's trivial with one as you can go through your elements and modify attributes easily.

Also see: RegEx match open tags except XHTML self-contained tags

Community
  • 1
  • 1
Lusitanian
  • 11,012
  • 1
  • 41
  • 38