473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RegExp.index (javascript) not working in Mozilla browser

hi,

i am using regexp.index in my javascript, IE supports this value but
mozilla gives undefined value for regexp.index. Is there any equivalent
method we can use for mozilla browsers.

regards,
sathya narayanan
mail @ : na*******@gsdindia.com

Jul 23 '05 #1
2 2369


sathya wrote:
i am using regexp.index in my javascript, IE supports this value but
mozilla gives undefined value for regexp.index. Is there any equivalent
method we can use for mozilla browsers.


I think you are looking for the index property of the result of an exec
call e.g. if you have a regular expression object
var pattern = /Kibo/g;
then you can call the exec method and check the index property of the
result returned by that method:
var match = pattern.exec('All for Kibology');
if (match != null) {
alert(match.index);
}
That should work across browsers.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
hi martin,
thankyou for your hlp...
I have another problem , i wabt to find index of my stratind and ending
tag in javascript , my word tag is as follow:

<zone>bla bla bla </zone>

i tried using regular expresion and i got result for IE browser , but
when i tried to implement my code in mozilla it shows bug in finding
index </zone> tag...
is there any solution for this problem...
plz help very urgent..
mail @; na*******@gsdindia.com

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve W | last post by:
I've searched over and over again and have not been able to find a definitive answer. Basically, we have a heavily JavaScripted web site. What I was hoping to do was to start enhancing our site...
5
by: Florian Proch | last post by:
Hi all... i'm currently working for a big project to construct a website. We need to support some browser and OS : IE 5.0 -> IE 6, Mozilla 1.2 -> 1.7, Opera 5 -> Opéra 7.5x, Netscape 4.75 -> NS...
20
by: RobG | last post by:
I'm messing with getPropertyValue (Mozilla et al) and currentStyle (IE) and have a general function (slightly modified from one originally posted by Steve van Dongen) for getting style properties:...
1
by: oreng | last post by:
Hey all, I have some problems detecting whether the client's browser javascript is enabled at the server side. While Request.Browser.JavaScript only check if the browser enable java script (and...
7
by: iannorton | last post by:
Hi, I'm trying to write a RegExp that will return search an array and return the closest 10 matches, for example, if i entered "Hel" and my array contained "Hello", "Hell", it would return Hello...
2
by: brad | last post by:
Hello all, I'm new to javascript--not too new to a few other programming languages--and I need your help deciphering the Regexp in the following string. Regular expresions are hard enough in...
2
by: Uldis Bojars | last post by:
Hi All, I have encountered problems with JS RegExp.exec() and can't find what is the problem. Could you help me? formRequest is a function that extracts some information from XMLHTTPRequest...
2
by: arungenesis | last post by:
Hello people, I'm working with HTML and Javascript. I have some problems in handling frames. I have the following questions: 1. How do I retrieve the name of a FRAME in IE & Mozilla using a...
4
by: Matt | last post by:
Hello all, I have just discovered (the long way) that using a RegExp object with the 'global' flag set produces inconsistent results when its test() method is executed. I realize that 'global'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.