← HALL

RegExp Global LastIndex State Trap

MEDIUM
+250 XP REWARD ⏱ Limit: 10m
// MISSION BRIEFING //

ANOMALY DESCRIPTION

A security token validator reuses a RegExp object with the '/g' flag. Calling test() consecutively alternates between true and false due to persistent lastIndex state! Fix the regex to test cleanly without state leakage.

SPECIFICATION SUITE

Valid uppercase 6-char
Input: 'DA4567'
Expected: true
Invalid lowercase
Input: 'da4567'
Expected: false
Consecutive valid test [PROTECTED TEST]
Evaluation logic hidden to prevent hardcoding.

RADAR HINTS

Hint #1 (Click to decrypt)

Remove the /g flag from the regular expression.

solution.js UTF-8 • JAVASCRIPT
STATIC ANALYSIS CONSOLE Ready for dispatch

Press "VERIFY & SUBMIT" or Ctrl+Enter to evaluate your patch.