regular expressions.

Peter Otten __peter__ at web.de
Fri Aug 8 13:03:06 CEST 2008


Atul. wrote:

> I have been playing around with REs and could not get the following
> code to run.
> 
> import re
> vowel = r'[aeiou]'
> re.findall(vowel, r"vowel")
> 
> anything wrong I have done?

Yes. You didn't paste the traceback into your message.
 
>>> import re
>>> vowel = r'[aeiou]'
>>> re.findall(vowel, r"vowel")
['o', 'e']

It works as expected here.

Peter



More information about the Python-list mailing list