Re: Remove some characters from a string

2008-07-17 Thread Fredrik Lundh
Julien wrote: I can't seem to find the right regular expression to achieve what I want. I'd like to remove all characters from a string that are not numbers, letters or underscores. For example: magic_function('[EMAIL PROTECTED]') str: 'si_98udasgf' the easiest way is to replace the things

Re: Remove some characters from a string

2008-07-17 Thread Paul Hankin
On Jul 17, 9:13 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > I can't seem to find the right regular expression to achieve what I > want. I'd like to remove all characters from a string that are not > numbers, letters or underscores. > > For example: > > >>> magic_function('[EMAIL PROTECTED]') >

Re: Remove some characters from a string

2008-07-17 Thread Chris
On Jul 17, 10:13 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > I can't seem to find the right regular expression to achieve what I > want. I'd like to remove all characters from a string that are not > numbers, letters or underscores. > > For example: > > >>> magic_function('[EMAIL PROTECTED]') >

Remove some characters from a string

2008-07-17 Thread Julien
Hi, I can't seem to find the right regular expression to achieve what I want. I'd like to remove all characters from a string that are not numbers, letters or underscores. For example: >>> magic_function('[EMAIL PROTECTED]') str: 'si_98udasgf' Would you have any hint? Thanks a lot! Julien --