<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def substring_search(query, list_of_strings, limit_results=DEFAULT_LIMIT):
 """ main function to call for searching """


    matching = []

    query_words = query.split(' ')

    # sort by longest word (higest probability of not finding a match)
    query_words.sort(key=len, reverse=True)

    counter = 0

    for s in list_of_strings:

        target_words = s.split(' ')

        # the anyword searching function is separate
        if(anyword_substring_search(target_words, query_words)):
            matching.append(s)

            # limit results
            counter += 1
            if(counter == limit_results):
                break

    return matching