Regex Javascript game