Use regex.test in lieu of str.match for speed.