<p>I am having some difficulty writing a function that will search through a directory for a file that matches a specific regular expression (which I have compiled using 're.compile'). So my question is: How do I search through a directory (I plan to use os.walk) for a file that matches a specific regular expression? An example would be very much appreciated. Thanks in advance. </p>

Read about the
RE
pattern's
```
match
```
method.
Read all answers to
How do I copy files with specific file extension to a folder in my python (version 2.5) script
?
Pick one that uses
```
fnmatch
```
.  Replace
```
fnmatch
```
with
```
re.match
```
.  This requires careful thought.  It's not a cut-and-paste.
Then, ask specific questions.