RegEx

Emile van Sebille emile at fenx.com
Tue May 14 11:17:32 EDT 2002


<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 '

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list