Closed Bug 387683 Opened 17 years ago Closed 17 years ago

RegExp.test() returns inconsistent results

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 98409

People

(Reporter: andrew.neitsch, Unassigned)

Details

Attachments

(1 file)

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
Attached file Test case
Duplicate of bug 98409
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: