alert(rl.test(l.name)+"\n"+rl.test(l.name)+"\n"+rl.test(l.name));
true false true
rl=/log[-_]?in|user[_-]?name|nick([-_]name)?/ig;
var rl = /log[\-_]?in|user[\-_]?name|nick(?:[\-_]name)?/ig; alert(rl.lastIndex); alert(rl.test('login')); alert(rl.lastIndex); alert(rl.test('login'));