RegExp.test is way faster than RegExp.exec