import re
text = 'The meeting is on 2023 - 10 - 15. Another event is set for 11/20/2024. And there is one more on 18 - Oct - 2025'
pattern = re.compile(r'(\d{4}-\d{2}-\d{2}|\d{2}/\d{2}/\d{4}|\d{2}-[a-zA-Z]{3}-\d{4})')
result_dict = {}
for match in pattern.finditer(text):
result_dict[match.group()] = match.span()
print(result_dict)
import re
text = 'The meeting is on 2023 - 10 - 15. Another event is set for 11/20/2024. And there is one more on 18 - Oct - 2025'
matches = re.findall(r'(\d{4}-\d{2}-\d{2}|\d{2}/\d{2}/\d{4}|\d{2}-[a-zA-Z]{3}-\d{4})', text)
result_dict = {match: (text.index(match), text.index(match) + len(match)) for match in matches}
print(result_dict)