adding tests and refactoring regex, seems slightly faster?