use delete_match instead of xfree to free match pointer