正则表达式不起作用 [英] regular expression not working

查看:125
本文介绍了正则表达式不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我使用了regexp javascript,它在IE,Mozilla和

Netscape中运行良好。但我无法弄清楚Safari浏览器中的问题。我的

正则表达式未在Safari浏览器中捕获。是否有任何

解决方案为所有浏览器制作通用正则表达式。

以及safari是否支持所有类型的基本正则表达式。


谢谢

问候,

sathya narayanan

邮件@: na ******* @ gsdindia.com

解决方案

sathya写道:< blockquote class =post_quotes>

我使用了regexp javascript,它在IE,Mozilla和Netscape中运行良好。但我无法弄清楚Safari浏览器中的问题。我的
正则表达式未在Safari浏览器中捕获。有没有为所有浏览器制作通用正则表达式的解决方案。
Safari是否支持所有类型的基本正则表达式。




有没有正则表达式和Safari的具体问题,

也许如果你发布一小部分显示

行为的代码,有人可以提供更好的答案。


-

Rob


hi robg,


我的样本代码如下:


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

var zoneTagArr = zoneTagRegExp.exec(bodyContent);

alert(zoneTagArr [0]);


这里我正在搜索字符串包含< ns2:Zone sathya ...>

我的代码在IE,firefox,netscape中运行良好,但它显示了

safari中的错误...

请你帮我这个regar ...




不能说我在Safari上知道,但正则表达式看起来很好。


Danny


周六,2005年7月2日08:33:26 -0700,sathya< sa *************** @ gmail.com>

写道:

-

使用Opera革命性的电子邮件客户端: http:// www .opera.com / mail /


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

解决方案

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


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



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/


这篇关于正则表达式不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆