473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Regular expression difference in NN.

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 ??

Help !!!!

-Prasanna.
Jul 23 '05 #1
4 1249


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/

Jul 23 '05 #2
I am using NN 7.2
It is really surprise that it is working in your test case.
Probably, my code is wrong. I will check again.
I am using more tags inside those <tr> tags.
thanks,
G.

Martin Honnen <ma*******@yahoo.de> wrote in message news:<40********@olaf.komtel.net>...
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.

Jul 23 '05 #3


Guru wrote:
I am using NN 7.2


I don't think Netscape 7.2 is out yet, the latest version offered at
http://channels.netscape.com/ns/browsers/default.jsp
is Netscape 7.1.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #4
I am sorry.
Typo..
it is Netscape 7.02
Martin Honnen <ma*******@yahoo.de> wrote in message news:<40******@olaf.komtel.net>...
Guru wrote:
I am using NN 7.2


I don't think Netscape 7.2 is out yet, the latest version offered at
http://channels.netscape.com/ns/browsers/default.jsp
is Netscape 7.1.

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Michael McGarry | last post by:
Hi, I am horrible with Regular Expressions, can anyone recommend a book on it? Also I am trying to parse the following string to extract the number after load average. ".... load average:...
1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
3
by: ocomet | last post by:
Hi Everyone.. I want to know how can I use regular expression in TextRange Object. I wrote specific word highlighting code and it is working now. but this is static word highlighting. I...
5
by: ad | last post by:
I found a Regular expression in http://www.regexlib.com/DisplayPatterns.aspx?cattabindex=6&categoryId=7What do the ^0, $ mean in the begin and end of Regular...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
9
by: Pete Davis | last post by:
I'm using regular expressions to extract some data and some links from some web pages. I download the page and then I want to get a list of certain links. For building regular expressions, I use...
6
by: Ludwig | last post by:
Hi, i'm using the regular expression \b\w to find the beginning of a word, in my C# application. If the word is 'public', for example, it works. However, if the word is '<public', it does not...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
1
by: Steve Barnett | last post by:
I'm attempting my first regular expression (ok, I nicked some of it from a blog) and I'm not seeing the results I expect to see. Given that it does not work, I find myself entirely stuck. Can you...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.