Enumerating and displaying files in the current directory and selecting by number to search for the file via cmd line
<p>I'm developing a command line tool that searches for certain string (hex, ascii, PAN etc...) data in log files. I have a few lines written that uses a regular expression to filter the search. Ideally, I want to be able to visually see all .txt and .log files in the current directory, have them enumerated, so I can choose a number to select a file to search through for a particular string (filtered by re). Any help is appreciated. Here's what I have so far:</p>

<pre><code>logfile = open("file.txt", "r")
regex = re.compile(r'3[1-9]\d{10}') #re search for a 12 digit string that starts with 3, 
#and whos second number is 0-9.

for line in logfile:
    search_string = regex.findall(line)
    for word in search_string:
        print word 
</code></pre>
