469,328 Members | 1,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

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 @: na*******@gsdindia.com

Jul 23 '05 #1
17 1525
sathya wrote:
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.


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
Jul 23 '05 #2
hi robg,

my sample code below:

var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");
var zoneTagArr = zoneTagRegExp.exec(bodyContent);
alert(zoneTagArr[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...

Jul 23 '05 #3

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 <sa***************@gmail.com>
wrote:
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #4
hi danny,
Is regexp works fine in macintosh pc's also where i am running my
safari btowsers

thanks
sathya narayanana

Jul 23 '05 #5
sathya wrote:
hi robg,

my sample code below:

var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");
var zoneTagArr = zoneTagRegExp.exec(bodyContent);
alert(zoneTagArr[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...


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

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

Jul 23 '05 #6
Danny wrote:

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
<sa***************@gmail.com> wrote:
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Is your broken style of posting due to the "revolutionary" 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.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #7
On 04/07/2005 09:29, Randy Webb wrote:
Danny wrote:
[top-post]
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Is your broken style of posting due to the "revolutionary" client you
are using


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


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.
Jul 23 '05 #8
Michael Winter wrote:
On 04/07/2005 09:29, Randy Webb wrote:
Danny wrote:

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

Is your broken style of posting due to the "revolutionary" client you
are using

Now, now. Don't be dragging Opera through the mud. :P


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.
or is it that you just don't understand how to post properly, in
accordance with the FAQ, in this group?

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


Probably so :)

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #9
On 04/07/2005 18:50, Randy Webb wrote:

[snip]
I actually like Opera,
Excellent. :)
and was trying to give him the benefit of the doubt
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.
as I have never used the Opera Email Client.


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.
Jul 23 '05 #10
Michael Winter wrote:
On 04/07/2005 18:50, Randy Webb wrote:


<snip>
as I have never used the Opera Email Client.

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.


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.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #11
On Mon, 04 Jul 2005 17:40:29 -0400, Randy Webb <Hi************@aol.com>
wrote:
Michael Winter wrote:
On 04/07/2005 18:50, Randy Webb wrote:


<snip>
as I have never used the Opera Email Client.

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.


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.


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 "revolutionary" though, I think I will
stick to Thunderbird for a while :(

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #12
sathya wrote:
hi robg,

Sorry, got sidetracked and forgot about this thread.
my sample code below:

var zoneTag = new RegExp("<ns[0-9]*:Zone .*?>","gim");
------------------------------------^

You may want to change that to '+' to match one or more digits rather
than zero or more (up to you).
var zoneTagArr = zoneTagRegExp.exec(bodyContent);
Here's your issue --------^^^^^^

var zoneTagArr = zoneTag.exec(bodyContent);

alert(zoneTagArr[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...


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(txt);
alert(zoneTagArr[0]);
">
--
Rob
Jul 23 '05 #13
JRS: In article <ue********************@comcast.com>, dated Mon, 4 Jul
2005 04:29:45, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
Danny wrote:

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
<sa***************@gmail.com> wrote:
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Is your broken style of posting due to the "revolutionary" 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?


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 <ln************@nuthaus.mib.org> :-
If you want to post a followup via groups.google.com, 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.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #14
On 05/07/2005 16:57, Dr John Stockton wrote:

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


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.
Jul 23 '05 #15
On 04/07/2005 22:51, Randy Webb wrote:

[snip]
One thing [M2] does that is counter-productive is that it puts the
cursor at the beginning (top)
I found that to be fairly convenient as I could just press Down a couple
of times to wherever I was going to start typing and, well, start typing. :)
so as to make top-posting seem "normal" (much the way Outlook does).
No, OE is much worse. It shifts the attribution and quoted text down to
produce an inviting space to type a reply. If the user has a signature,
that's included above the attribution, too.

All M2 does is put the cursor on the same line as the attribution; the
signature is still in the right place.
It is also still wrapping at 80 characters. Yuck!
There's no defense against that. I would have hoped that it was fixed by
now.

[snip]
If this is indicative of being "revolutionary" though, I think I will
stick to Thunderbird for a while :(


I'm not sure where the 'revolutionary' thing comes from. Perhaps it was
the first integrated mail client before the Mozilla Suite software? I
don't know.

We have an Opera employee reading this group from time-to-time. Perhaps
he might take note. ;)

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jul 23 '05 #16
Michael Winter wrote:
On 05/07/2005 16:57, Dr John Stockton wrote:

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

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.


Isn't that typical troll-ish behavior though? :-)

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #17
On Tue, 05 Jul 2005 20:40:04 +0200, Michael Winter
<m.******@blueyonder.co.uk> wrote:
We have an Opera employee reading this group from time-to-time. Perhaps
he might take note. ;)


Hey, was that a bait?
Sorry to answer even though it's really off-topic. To clear my conscience
I set an appropriate follow-up :)
It is also still wrapping at 80 characters. Yuck!


There's no defense against that. I would have hoped that it was fixed by
now.


It is possible to turn wrapping off in the preferences.
You can alternatively edit the accounts.ini-file:

Linelength=76

It is a per-account setting.
If this is indicative of being "revolutionary" though, I think I will
stick to Thunderbird for a while :(


I'm not sure where the 'revolutionary' thing comes from. Perhaps it was
the first integrated mail client before the Mozilla Suite software? I
don't know.


It's the automated filtering (e.g. auto-detecting mailing lists,
automatically sorting by contacts) and smart search options we thought was
revolutionary. You know, when GMail says "search, don't sort" - we did it
first, and search works much faster since all your mail is locally stored
:)

Anyway, for features see
http://www.opera.com/products/desktop/m2/

<semi-semi-on-topic>It also supports filtering by regular
expressions.</semi-semi-on-topic>
--
Hallvord R. M. Steen
Core QA JavaScript tester, Opera Software
http://www.opera.com/
Opera - simply the best Internet experience
Jul 23 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sehboo | last post: by
6 posts views Thread by Ludwig | last post: by
3 posts views Thread by Zach | last post: by
25 posts views Thread by Mike | last post: by
6 posts views Thread by rorymo | last post: by
4 posts views Thread by carlos | last post: by
18 posts views Thread by Lit | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.