Guru wrote:
I am using a string which has <tr> tags inside it.
I want to do a greedy search on it.
For eg.. if that string contains,
<nothing><tr>bla</tr><tr>blablabla</tr><tr>hi</tr></nothing>
I want to extract the things inside <tr>..</tr> tags.
Like,
<tr>bla</tr><tr>blablabla</tr><tr>hi</tr>
I wrote regular expression
1.var extractTR = /<tr(.|\n|\r)*<\/tr>/mgi;
2.table_tr_arr = withReportPage.match(extractTR); //withReportPage is
the string.
When i execute in IE, everything is working, but when i open it in
NN 7, it is crashing when that line is executed !. Seems greedy search
is not supported in NN7 ??
Sure it is, it is the default matching anyway so there is nothing in the
ECMAScript regular expression pattern language to indicate you want
greedy matching.
Of course scripting engines can have bug, browsers can have bugs but I
am not able to reproduce any problem here, as you haven't provided a
full test case I have made one using the snippets you have provided
above, it is here:
http://home.arcor.de/martin.honnen/j...t20040720.html
It doesn't crash Netscape 7.1 (Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)) here on Windows XP and
shows the same result as Opera 7 and IE 6.
If you have problems make a test case showing the problem and post a URL
and tell us which browser version you have tested with. Or if the above
test case crashes your Netscape 7 then please post the exact version.
--
Martin Honnen
http://JavaScript.FAQTs.com/