regexp help

Dave Angel davea at ieee.org
Wed Nov 4 22:03:57 CET 2009



Simon Brunning wrote:
> 2009/11/4 Nadav Chernin <Nadav.C at qualisystems.com>:
>   
>> Thanks, but my question is how to write the regex.
>>     
>
> re.match(r'.*\.(exe|dll|ocx|py)$', the_file_name) works for me.
>
>   
How about:
os.path.splitext(x)[1] in  (".exe", ".dll", ".ocx", ".py"):

DaveA



More information about the Python-list mailing list