Question: Here is my code:

```
var str="<table><tr><td>abraham</td></tr></table>";

```

How to get **abraham** by matching `td` ?

I tried but failed, I don't want to match `table` or `tr`, I want to only match `td`.

```
<!DOCTYPE html>
<html>
<body>

<script>
var str="<table><tr><td>anilkumar</td>";
var patt1=/<td>(\w+)<\/td>/;
document.write(str.match(patt1));
</script>

</body>
</html>

```

It ruturns **null**.

Answer: 
This should suit your needs:

```none
<td>(.*?)</td>

```

Demo [here](http://jsfiddle.net/hUpQm/).
Use this Expression : `^<\s*(td|TD)\s*(\w|\W)*\s*>(\w|\W)*</(td|TD)>$`

This match *\** in html,so any other html mark with is just do a little change to this

Perfect Matches : `<td>hello kitty</td> OR <TD WIDTH='20></TD> OR <TD >&NBSP;</td>`