Am Thu, 17 Mar 2005 06:51:19 -0800 schrieb qwweeeit: > Splitting with RE has (for me!) misterious behaviour! > > I want to get the words from this string: > s= 'This+(that)= a.string!!!' > > in a list like that ['This', 'that', 'a.string'] > considering "a.string" as a word.
Hi, try this: re.findall(r'[\w\.]+', s) ['This', 'that', 'a.string'] If you use r'...' you don't need to use \\ if you mean \ \w matches a-zA-Z0-9_ \W matches all except \w Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.python.org/mailman/listinfo/python-list