added tests and fixed reg ex