In both Netscape 4/6, the use of the global flag in a Regular Expression causes it to fail on subsequent usage. This is not a problem with Internet Explorer 5/6. For example, /abc/gi.exec("xxabcxx") succeeds the first time itís used but fails if the same Regular Expression is used later, e.g., /abc/gi.exec("yyabcyy"). There does not appear to be a problem with the ignore flag.
A workaround is to use the Regular Expression constructor function and the compile method. This adds some overhead but it does work in all browsers. Below is an example of how this can be done.
YAMF - "Yet Another Mouse Follower"
All Is Not What It Seems
Netscape 6 Made Me Do It!
Testing - To Reload or To Restart?
Browser Sniffing - Parse or Presence?
Stopping Annoying Auto-Scroll in DOM2 Browsers
Netscape 6 is Pixel Picky
Inline Style Constraint on Internet Explorer 5
Must Use <LAYER> tag in Netscape 4 to perform DHTML
!DOCTYPE Compliance Mode
Take Care Not to Render in <HEAD> Section
Automatic Expansion of Relative URLs
The Elusive Netscape 4 Layer Elements
Temperamental onLoad After Reload
document.images[id].complete Property Dependency
Search Method Does Not Return Boolean Value
Regular Expression Global Flag Fails With Subsequent Usage
Roll Your Own
|Copyright © 2002-2003, ProjectIt, All Rights Reserved||Last Revised:|