you're using `match[0].length` twice, you should use a var