Search dir and subdirs
<p>I am attempting to make this function (that searches a dir for a given string) search all sub dirs as well, and do this recursively. I don't know Python well enough to begin. Any guidance would be great.</p>

<p>Thanks!</p>

<pre><code>def grep(regex, base_dir):
    matches = list()
    for filename in os.listdir(base_dir):
        full_filename = os.path.join(base_dir, filename)
        if not os.path.isfile(full_filename):
            continue
        with open(os.path.join(base_dir, filename)) as fh:
            content = fh.read()
            matches = matches + re.findall(regex, content)
    return matches
</code></pre>
