RegEx

Sean 'Shaleh' Perry shalehperry at attbi.com
Tue May 14 11:45:21 EDT 2002


On 14-May-2002 Emile van Sebille wrote:
> <jar at mminternet.com>
>> I have a quick regular expression question.
>>
>> I'm trying to substute all parathesis -- both left and right -- with a
>> space.  I've tried:
> 
> 
> I'm not up on regular expressions, so I'd do:
> 
>>>> s = "(1)(2)(3)(4)"
>>>> s.replace("("," ").replace(")"," ")
> ' 1  2  3  4 '
> 

more importantly this might be faster, although I dislike the foo.bar().baz()
style of coding used here and would do it on two lines.





More information about the Python-list mailing list