1import re
2# matches_position_start will be a list of starting index positions
3matches_start = re.finditer(word.lower(), string.lower())
4matches_position_start = [match.start() for match in matches_start]
5
6# matches_position_end will be a list of ending index positions
7matches_end = re.finditer(word.lower(), string.lower())
8matches_position_end = [match.end() for match in matches_end]