def find_all(s, pattern):
    """return ordered list of indexes where [pattern] appears in [s];
    """
    shift_on_match = 1
    i = 0
    indexes = []
    while 1:
        i = string.find(s, pattern, i)
        if i >= 0:
            indexes.append(i)
            i = i + shift_on_match
        else:
            break
    return indexes
return ordered list of indexes where [pattern] appears in [s];
    
recipes/Python/576606_Unrestricted_Grammar_used_like/recipe-576606.py