Re: regular expressions.

2008-08-08 Thread Alexei Zankevich
Use the print statement: import re vowel = r'[aeiou]' print re.findall(vowel, r"vowel") Alexey On Fri, Aug 8, 2008 at 2:17 PM, Atul. <[EMAIL PROTECTED]> wrote: > > > Yes. You didn't paste the traceback into your message. > > > > >>> import re > > >>> vowel = r'[aeiou]' > > >>> re.findall(vowel,

Re: regex question

2008-08-05 Thread Alexei Zankevich
=) Indeed. But it will replace all dots including ordinary strings instead of numbers only. On Tue, Aug 5, 2008 at 3:23 PM, Jeff <[EMAIL PROTECTED]> wrote: > On Aug 5, 7:10 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > On Tue, 05 Aug 2008 11:39:36 +0100, Fred Mangusta wrote: > > > I

Re: regex question

2008-08-05 Thread Alexei Zankevich
No, there is a bad way - because of the example doesn't solve arbitrary amount of ... blocks. But the python regexp engine supports for lookahead (?=pattern) and lookbehind (?<=pattern). In those cases patterns are not included into the replaced sequence of characters: >>> re.sub('(?<=\d)\.(?=\d)',

Fwd: Unit testing type comparison

2008-08-04 Thread Alexei Zankevich
Hello Mike, The reason of the problem is that the class Test was not pushed into the sys.modules. Use one more separate module for that stuff: *one.py* class Test(object): '''just define''' *three.py* from one import Test #push one.pyc to sys.modules if __name__ == '__main__': import two