regexp testing, test code cleanup