var g = /1/g; g.exec('1234561'); g.exec(); var r = /uDC38/ug; r.lastIndex = 1; var str = "\uD83D\uDC38"; r.exec(str);