fixed broken regex, added tests