Re: regexp questoin

2006-06-11 Thread Simon Brunning
On 9 Jun 2006 17:44:42 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > actually, i am doing an application that allows user to delete files by > entering an input pattern. If you are looking to match filenames, you might want to have a look at the fnmatch and glob modules. The patterns that

Re: regexp questoin

2006-06-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > actually, i am doing an application that allows user to delete files by > entering an input pattern. so if he has files that have special > characters such as [-] or others, then i want to filter them off I think you will have to define what "pattern" means here.

Re: regexp questoin

2006-06-09 Thread micklee74
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > > command line argument > > that r"%s" % (userinput) thing is a pointless operation: the "r" prefix > controls how backslashes in a string literal is parsed; the result is an

Re: regexp questoin

2006-06-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > command line argument that r"%s" % (userinput) thing is a pointless operation: the "r" prefix controls how backslashes in a string literal is parsed; the result is an ordinary string ("%s" in this ca

Re: regexp questoin

2006-06-09 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > hi > > i created a script to ask user for an input that can be a pattern > right now, i use re to compile that pattern > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > command line argument > if the user key in a pattern , eg [-] , and my script will

Re: regexp questoin

2006-06-09 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > hi > > i created a script to ask user for an input that can be a pattern > right now, i use re to compile that pattern > pat = re.compile(r"%s" %(userinput) ) #userinput is passed from > command line argument > if the user key in a pattern , eg [-] , and my script will

regexp questoin

2006-06-09 Thread micklee74
hi i created a script to ask user for an input that can be a pattern right now, i use re to compile that pattern pat = re.compile(r"%s" %(userinput) ) #userinput is passed from command line argument if the user key in a pattern , eg [-] , and my script will search some lines that contains [-] p