RegExp.test() returns inconsistent results

RESOLVED DUPLICATE of bug 98409

Status

()

RESOLVED DUPLICATE of bug 98409
11 years ago
11 years ago

People

(Reporter: andrew.neitsch, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

The javascript

var val = "06/06/2007";
var re = /^[0-9 \/:]*$/ig;
document.write(re.test(val) + '<br>');
document.write(re.test(val) + '<br>');
document.write(re.test(val) + '<br>');

prints "true false true". Since neither val or re has changed, I expect re.test(val) to always return true.

Reproducible: Always
(Reporter)

Comment 1

11 years ago
Created attachment 271835 [details]
Test case

Comment 2

11 years ago
Duplicate of bug 98409

Updated

11 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 98409
You need to log in before you can comment on or make changes to this bug.