changed the way exceptions are tested
added test for unmatched regex and replace