Regular expression to match any table tag
- by keeg
I'm trying to write a regular expression to see if a string contains any of the typical table tags:
<table></table>
<td></td>
<th></th>
<tr></tr>
<thead></thead>
<tfoot></tfoot>
<tbody></tbody>
Along with tags that may contain other attributes e.g:
<table border="1">
I've come up with this so far, however, it matches <br /> tag and I'm not sure why:
/<\/?[table|td|th|tr|tfoot|thead|tbody]{1,}>?/
http://www.rexfiddle.net/20Xtqka