regular expression not working

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

    regular expression not working

    hi,

    i have used regexp javascript which works fine in IE, Mozilla and
    Netscape. But i cannot figure out problem in safari browsers. My
    regular expression is not captured in safari browsers. Is there any
    solution for making common regular expression for all browsers.
    And whether safari supports all kind of basic regular expression.

    Thanks
    regards,
    sathya narayanan
    mail @: narayanan@gsdin dia.com

  • RobG

    #2
    Re: regular expression not working

    sathya wrote:[color=blue]
    > hi,
    >
    > i have used regexp javascript which works fine in IE, Mozilla and
    > Netscape. But i cannot figure out problem in safari browsers. My
    > regular expression is not captured in safari browsers. Is there any
    > solution for making common regular expression for all browsers.
    > And whether safari supports all kind of basic regular expression.[/color]

    There are no specific issues with regular expressions and Safari,
    perhaps if you post a small sample of code that displays the
    behaviour someone can provide a better answer.

    --
    Rob

    Comment

    • sathya

      #3
      Re: regular expression not working

      hi robg,

      my sample code below:

      var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");
      var zoneTagArr = zoneTagRegExp.e xec(bodyContent );
      alert(zoneTagAr r[0]);

      here i am searching for string that contains <ns2:Zone sathya...>
      my code works well in IE , firefox , netscape, but it shows bug in
      safari...
      please can you help me in this regar...

      Comment

      • Danny

        #4
        Re: regular expression not working


        Can't say I know on Safari, but the regexp looks fine to me.

        Danny

        On Sat, 02 Jul 2005 08:33:26 -0700, sathya <sathyanarayana nit@gmail.com>
        wrote:


        --
        Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

        Comment

        • sathya

          #5
          Re: regular expression not working

          hi danny,
          Is regexp works fine in macintosh pc's also where i am running my
          safari btowsers

          thanks
          sathya narayanana

          Comment

          • Christopher J. Hahn

            #6
            Re: regular expression not working

            sathya wrote:[color=blue]
            > hi robg,
            >
            > my sample code below:
            >
            > var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");
            > var zoneTagArr = zoneTagRegExp.e xec(bodyContent );
            > alert(zoneTagAr r[0]);
            >
            > here i am searching for string that contains <ns2:Zone sathya...>
            > my code works well in IE , firefox , netscape, but it shows bug in
            > safari...
            > please can you help me in this regar...[/color]

            Maybe I missed something but shouldn't this:
            var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");
            var zoneTagArr = zoneTagRegExp.e xec(bodyContent );

            be
            var zoneTagRegExp = new RegExp("<ns[0-9]*:Zone .*?>","gim");
            var zoneTagArr = zoneTagRegExp.e xec(bodyContent );
            ?

            Comment

            • Randy Webb

              #7
              Re: regular expression not working

              Danny wrote:[color=blue]
              >
              > Can't say I know on Safari, but the regexp looks fine to me.
              >
              > Danny
              >
              > On Sat, 02 Jul 2005 08:33:26 -0700, sathya
              > <sathyanarayana nit@gmail.com> wrote:
              >
              >
              > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/[/color]

              Is your broken style of posting due to the "revolution ary" client you
              are using or is it that you just don't understand how to post properly,
              in accordance with the FAQ, in this group?

              --
              Randy
              comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

              Comment

              • Michael Winter

                #8
                Re: regular expression not working

                On 04/07/2005 09:29, Randy Webb wrote:
                [color=blue]
                > Danny wrote:[/color]

                [top-post]
                [color=blue][color=green]
                >> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/[/color]
                >
                > Is your broken style of posting due to the "revolution ary" client you
                > are using[/color]

                Now, now. Don't be dragging Opera through the mud. :P
                [color=blue]
                > or is it that you just don't understand how to post properly, in
                > accordance with the FAQ, in this group?[/color]

                I doubt understanding has anything to do with this; refusal is more
                accurate.

                Mike

                --
                Michael Winter
                Prefix subject with [News] before replying by e-mail.

                Comment

                • Randy Webb

                  #9
                  Re: regular expression not working

                  Michael Winter wrote:[color=blue]
                  > On 04/07/2005 09:29, Randy Webb wrote:
                  >[color=green]
                  >> Danny wrote:[/color]
                  >
                  >
                  > [top-post]
                  >[color=green][color=darkred]
                  >>> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/[/color]
                  >>
                  >>
                  >> Is your broken style of posting due to the "revolution ary" client you
                  >> are using[/color]
                  >
                  >
                  > Now, now. Don't be dragging Opera through the mud. :P[/color]

                  I actually like Opera, and was trying to give him the benefit of the
                  doubt as I have never used the Opera Email Client. I looked at it in O8
                  last night but didn't have time to try to use it.
                  [color=blue][color=green]
                  >> or is it that you just don't understand how to post properly, in
                  >> accordance with the FAQ, in this group?[/color]
                  >
                  >
                  > I doubt understanding has anything to do with this; refusal is more
                  > accurate.[/color]

                  Probably so :)

                  --
                  Randy
                  comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

                  Comment

                  • Michael Winter

                    #10
                    Re: regular expression not working

                    On 04/07/2005 18:50, Randy Webb wrote:

                    [snip]
                    [color=blue]
                    > I actually like Opera,[/color]

                    Excellent. :)
                    [color=blue]
                    > and was trying to give him the benefit of the doubt[/color]

                    I think I've mentioned not to top-post at least four times in replies,
                    and I noticed Richard did too quite recently. Others might have in
                    threads I didn't read.
                    [color=blue]
                    > as I have never used the Opera Email Client.[/color]

                    I did for several months and then switched to Thunderbird after
                    reinstalling XP. The only thing I didn't really like was wrapping; it
                    was fixed at 80 characters and I always ended up having to wrap manually
                    before posting. I suggested changes, but I haven't used M2 in O8, so I
                    don't know if anything's been implemented.

                    [snip]

                    Mike

                    --
                    Michael Winter
                    Prefix subject with [News] before replying by e-mail.

                    Comment

                    • Randy Webb

                      #11
                      Re: regular expression not working

                      Michael Winter wrote:
                      [color=blue]
                      > On 04/07/2005 18:50, Randy Webb wrote:
                      >[/color]

                      <snip>
                      [color=blue][color=green]
                      >> as I have never used the Opera Email Client.[/color]
                      >
                      >
                      > I did for several months and then switched to Thunderbird after
                      > reinstalling XP. The only thing I didn't really like was wrapping; it
                      > was fixed at 80 characters and I always ended up having to wrap manually
                      > before posting. I suggested changes, but I haven't used M2 in O8, so I
                      > don't know if anything's been implemented.[/color]

                      I think I am going to play around with it this week to see how I may/may
                      not like it. I use Thunderbird right now but have never had time to sit
                      and go through it to find how to change the things I would want to
                      change. Might give me something to do in some free time, and who knows,
                      might start using O8 for news instead.

                      --
                      Randy
                      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

                      Comment

                      • Randy Webb

                        #12
                        Re: regular expression not working

                        On Mon, 04 Jul 2005 17:40:29 -0400, Randy Webb <HikksNotAtHome @aol.com>
                        wrote:
                        [color=blue]
                        > Michael Winter wrote:
                        >[color=green]
                        >> On 04/07/2005 18:50, Randy Webb wrote:
                        >>[/color]
                        >
                        > <snip>
                        >[color=green][color=darkred]
                        >>> as I have never used the Opera Email Client.[/color]
                        >> I did for several months and then switched to Thunderbird after
                        >> reinstalling XP. The only thing I didn't really like was wrapping; it
                        >> was fixed at 80 characters and I always ended up having to wrap
                        >> manually before posting. I suggested changes, but I haven't used M2 in
                        >> O8, so I don't know if anything's been implemented.[/color]
                        >
                        > I think I am going to play around with it this week to see how I may/may
                        > not like it. I use Thunderbird right now but have never had time to sit
                        > and go through it to find how to change the things I would want to
                        > change. Might give me something to do in some free time, and who knows,
                        > might start using O8 for news instead.
                        >[/color]

                        This is being posted with Opera 8's email client. One thing it does that
                        is counter-productive is that it puts the cursor at the beginning (top) so
                        as to make top-posting seem "normal" (much the way Outlook does). It is
                        also still wrapping at 80 characters. Yuck!

                        The above was just typed in, so going to post it to see how it wraps it on
                        its own.

                        If this is indicative of being "revolution ary" though, I think I will
                        stick to Thunderbird for a while :(

                        --
                        Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

                        Comment

                        • RobG

                          #13
                          Re: regular expression - the answer...

                          sathya wrote:[color=blue]
                          > hi robg,
                          >[/color]

                          Sorry, got sidetracked and forgot about this thread.
                          [color=blue]
                          > my sample code below:
                          >
                          > var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");[/color]

                          ------------------------------------^

                          You may want to change that to '+' to match one or more digits rather
                          than zero or more (up to you).
                          [color=blue]
                          > var zoneTagArr = zoneTagRegExp.e xec(bodyContent );[/color]

                          Here's your issue --------^^^^^^

                          var zoneTagArr = zoneTag.exec(bo dyContent);

                          [color=blue]
                          > alert(zoneTagAr r[0]);
                          >
                          > here i am searching for string that contains <ns2:Zone sathya...>
                          > my code works well in IE , firefox , netscape, but it shows bug in
                          > safari...
                          > please can you help me in this regar...
                          >[/color]

                          Test (works in Firefox and Safari but not IE on Mac):

                          <input type="button" value="Click me" onclick="
                          var txt = '<ns223:Zone sathya blah blah>';
                          var zoneTag = new RegExp('<ns[0-9]*:Zone .*?>','gim');
                          var zoneTagArr = zoneTag.exec(tx t);
                          alert(zoneTagAr r[0]);
                          ">


                          --
                          Rob

                          Comment

                          • Dr John Stockton

                            #14
                            Re: regular expression not working

                            JRS: In article <ueCdnR_2u4DLbl XfRVn-vg@comcast.com> , dated Mon, 4 Jul
                            2005 04:29:45, seen in news:comp.lang. javascript, Randy Webb
                            <HikksNotAtHome @aol.com> posted :[color=blue]
                            >Danny wrote:[color=green]
                            >>
                            >> Can't say I know on Safari, but the regexp looks fine to me.
                            >>
                            >> Danny
                            >>
                            >> On Sat, 02 Jul 2005 08:33:26 -0700, sathya
                            >> <sathyanarayana nit@gmail.com> wrote:
                            >>
                            >>
                            >> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/[/color]
                            >
                            >Is your broken style of posting due to the "revolution ary" client you
                            >are using or is it that you just don't understand how to post properly,
                            >in accordance with the FAQ, in this group?[/color]

                            The FAQ has not been updated for a long time; in particular, while it
                            does describe the desired effect, it does not say how to get it when,
                            like Danny, one is using Google.


                            Danny, if you find that, when you start a News reply, Google does not
                            provide the previous article in quoted form, note what Keith Thompson
                            wrote in comp.lang.c, message ID <lnwtuhfy7d.fsf @nuthaus.mib.or g> :-
                            If you want to post a followup via groups.google.c om, don't use
                            the "Reply" link at the bottom of the article. Click on "show
                            options" at the top of the article, then click on the "Reply" at
                            the bottom of the article headers.

                            --
                            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
                            Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
                            Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
                            No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

                            Comment

                            • Michael Winter

                              #15
                              Re: regular expression not working

                              On 05/07/2005 16:57, Dr John Stockton wrote:

                              [snip]
                              [color=blue]
                              > The FAQ [...] does not say how to [post properly] when, like Danny,
                              > one is using Google.[/color]

                              But Danny isn't using Google. That's why his signature says he posts
                              using Opera, as does the User-Agent header. :P

                              Opera is perfectly capable of forming properly formatted posts. He
                              /refuses/ to.

                              Mike

                              --
                              Michael Winter
                              Prefix subject with [News] before replying by e-mail.

                              Comment

                              Working...