Add some tests, refactor regex constants and .convert method logic