@staticmethod
def find_all_offsets(pattern, text, offset=0):
    """Don't use regular expressions as they are a tad slow"""
    matches = []
    pattern_len = len(pattern)
    next_match = text.find(pattern)
    while next_match != -1:
        matches.append((next_match + offset, next_match + pattern_len + offset)
            )
        next_match = text.find(pattern, next_match + 1)
    return matches
