473,804 Members | 3,716 Online
Bytes | Software Development & Data Engineering Community
+ 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>bl a</tr><tr>blablabl a</tr><tr>hi</tr></nothing>

I want to extract the things inside <tr>..</tr> tags.
Like,
<tr>bla</tr><tr>blablabl a</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 1271


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>bl a</tr><tr>blablabl a</tr><tr>hi</tr></nothing>

I want to extract the things inside <tr>..</tr> tags.
Like,
<tr>bla</tr><tr>blablabl a</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*******@yaho o.de> wrote in message news:<40******* *@olaf.komtel.n et>...
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>bl a</tr><tr>blablabl a</tr><tr>hi</tr></nothing>

I want to extract the things inside <tr>..</tr> tags.
Like,
<tr>bla</tr><tr>blablabl a</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*******@yaho o.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
2433
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: 0.04, 0.02, 0.01" how can I extract this number with RE or otherwise?
1
4187
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 regular expressions easier to create and use (and in my experience as a regular expression user, it makes them MUCH easier to create and use.) I'm still working on formal documentation, and in any case, such documentation isn't necessarily the...
3
1432
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 want to emplement dynamic word highlighting using regular expression..
5
1750
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 expression?^0{1}{0,1}{0,1}{0,1}{1}{6}$
7
3833
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 want to avoid that. My question here is if there is a way to pass either a memory stream or array of "find", "replace" expressions or any other way to avoid multiple copies of a string. Any help will be highly appreciated
9
3363
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 an app call The Regulator, which makes it pretty easy to build and test regular expressions. As a warning, I'm real weak with regular expressions. Let's say my regular expression is:
6
2294
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 work: it seems that < is not a valid character, so the beginning of the word starts at theletter 'p' instead of '<'. Because I'm not an expert in regular expressions, maybe someone of you guys can help me? I need the correct regex to find the...
25
5177
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 (CONDUCTION DEFECT) 37.33/2 HEART (CONDUCTION DEFECT) WITH CATHETER 37.34/2 " the expression is "HEART (CONDUCTION DEFECT)". How do I gain access to the expression (not the matches) at runtime? Thanks, Mike
1
2821
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 help? I'm trying to split command line parameters specified in the format: /Startup /Model=a /view="b" /entity="/c" Where all command line parameters start with a forward slash. They may or may not have values following an equals sign (I plan...
0
9707
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
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.