# Extract matched text for match_id, start, end in matches: # Get the matched span matched_span = doc[start:end] print(matched_span.text)