apologies -- I just reread your post and appears you also want to capture the dot after each "b" ( "b." )
In that case, you need to update the pattern to match for the dot. But because the dot is itself a metacharacter, you have to escape it with a backslash: In [23]: re.findall(r'a\w+b\.',text) Out[23]: ['a2345b.', 'a45453b.', 'a325643b.', 'a435643b.'] Again, all of these features are explained nicely at http://www.amk.ca/python/howto/regex/ _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor