Release the cursor after the match is over.