JavaScript: Regex.test() only works every other time | Hacker News Reader