From: Simon Brunning on 4 Nov 2009 11:43 2009/11/4 Nadav Chernin <Nadav.C(a)qualisystems.com>: > Iâm trying to write regexp that find all files that are not with next > extensions: Â exe|dll|ocx|py, Â but canât find any command that make it. http://code.activestate.com/recipes/499305/ should be a good start. Use the re module and your regex instead of fnmatch.filter(), and you should be good to go. -- Cheers, Simon B.
From: Nadav Chernin on 4 Nov 2009 12:05 Thanks, but my question is how to write the regex. -----Original Message----- From: simon.brunning(a)gmail.com [mailto:simon.brunning(a)gmail.com] On Behalf Of Simon Brunning Sent: × 04 × ××××ר 2009 18:44 To: Nadav Chernin; Python List Subject: Re: regexp help 2009/11/4 Nadav Chernin <Nadav.C(a)qualisystems.com>: > Iâm trying to write regexp that find all files that are not with next > extensions:  exe|dll|ocx|py,  but canât find any command that make it. http://code.activestate.com/recipes/499305/ should be a good start. Use the re module and your regex instead of fnmatch.filter(), and you should be good to go. -- Cheers, Simon B.
From: Simon Brunning on 4 Nov 2009 12:12 2009/11/4 Nadav Chernin <Nadav.C(a)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. -- Cheers, Simon B.
From: Carsten Haese on 4 Nov 2009 12:13 Nadav Chernin wrote: > Thanks, but my question is how to write the regex. See http://www.amk.ca/python/howto/regex/ . -- Carsten Haese http://informixdb.sourceforge.net
From: Nadav Chernin on 4 Nov 2009 12:16 No, I need all files except exe|dll|ocx|py -----Original Message----- From: simon.brunning(a)gmail.com [mailto:simon.brunning(a)gmail.com] On Behalf Of Simon Brunning Sent: × 04 × ××××ר 2009 19:13 To: Nadav Chernin Cc: Python List Subject: Re: regexp help 2009/11/4 Nadav Chernin <Nadav.C(a)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. -- Cheers, Simon B.
|
Next
|
Last
Pages: 1 2 Prev: How to test urllib|urllib2-using code? Next: 2to3 on Mac - unknown encoding: mbcs |