removed the  since it is is a reserved word for ES6, and it's future implementation does not match with the current use.
added missing use strict statement. wrapped the code into a global closure. fixed unescaped dot in regexs