Test method to cancel long running regex