Regular expression difference in NN.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guru

    #1

    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.
  • Martin Honnen

    #2
    Re: Regular expression difference in NN.



    Guru wrote:
    [color=blue]
    > 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 ??[/color]

    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:

    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/

    Comment

    • Guru

      #3
      Re: Regular expression difference in NN.

      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 <mahotrash@yaho o.de> wrote in message news:<40fd445d$ 1@olaf.komtel.n et>...[color=blue]
      > Guru wrote:
      >[color=green]
      > > 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 ??[/color]
      >
      > 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.[/color]

      Comment

      • Martin Honnen

        #4
        Re: Regular expression difference in NN.



        Guru wrote:
        [color=blue]
        > I am using NN 7.2[/color]

        I don't think Netscape 7.2 is out yet, the latest version offered at

        is Netscape 7.1.


        --

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

        Comment

        • Guru

          #5
          Re: Regular expression difference in NN.

          I am sorry.
          Typo..
          it is Netscape 7.02


          Martin Honnen <mahotrash@yaho o.de> wrote in message news:<40fe6cff@ olaf.komtel.net >...[color=blue]
          > Guru wrote:
          >[color=green]
          > > I am using NN 7.2[/color]
          >
          > 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.[/color]

          Comment

          Working...