regular express quetion - what's wrong with my expression? : i have a difficult by build a regex.
Suppose there is a html clip as under.
I want to use Javascript to cut the <tbody> part with the link of "apple"(which <a> is inside of the <td class="by">)
I make the expression : 

    /<tbody.*?text[\s\S]*?<td class="by"[\s\S]*?<a.*?>apple<\/a>[\s\S]*?<\/tbody>/g

But the result is different as i wanted. Each match contains more than one block of <tbody>. How it should be? Regards!!!!
 

       <tbody id="text_0">
        	<td class="by">
        		<a href="xxx">cat</a>
        	</td>
        </tbody>
        <tbody id="text_1">
        	<td class="by">
        		<a href="xxx">apple</a>
        	</td>
        </tbody>
        <tbody id="text_2">
        	<td class="by">
        		<a href="xxx">cat</a>
        	</td>
        </tbody>
        <tbody id="text_3">
        	<td class="by">
        		<a href="xxx">tiger</a>
        	</td>
        </tbody>
        <tbody id="text_4">
        	<td class="by">
        		<a href="xxx">banana</a>
        	</td>
        </tbody>
        <tbody id="text_5">
        	<td class="by">
        		<a href="xxx">peach</a>
        	</td>
        </tbody>
        <tbody id="text_6">
        	<td class="by">
        		<a href="xxx">apple</a>
        	</td>
        </tbody>
        <tbody id="text_7">
        	<td class="by">
        		<a href="xxx">banana</a>
        	</td>
        </tbody>