how can I separate a HTML table tag from string by using regular expression?
var sTabString =' ... <table > <table ... any string ... id="Unique_1" ... any string ...> abc def <table > ... ';
var sReg = '< *table .* id *= *"Unique_1" .*>';
var sRegEx = new RegExp(sReg);
var sResult = sTabString .match(sRegEx);
alert(sResult);
I expect the open tag with all its attributes as follows:
<table ... any string ... id="Unique_1" ... any string ...>
<table id="foo" class="table-bordered"><thead><tr><th>Hi</th></tr></thead></table>he wants<table id="foo" class="table-bordered">(the open tag).