Serdar Tumgoren <zstumgo...@gmail.com> writes: > Hey Tiago, > >> text = "a2345b. f325. a45453b. a325643b. a435643b. g234324b." >> >> Of this line of text, I want to take out strings where all words start >> with a, end with "b.". But I don't want a list of words. I want that: >> >> ["a2345b.", "a45453b. a325643b. a435643b."] >> > > Are you saying you want a list of every item that starts with an "a" > and ends with a "b"? If so, the above list is not what you're after. > It only contains two items: > a2345b. > a45453b. a325643b. a435643b.
Yes, I want to find only two items. I want every sequence of words where every word begins with an "a" and ends with "b.". > Try reading this: > http://www.amk.ca/python/howto/regex/ I have read several times, and I thought I understood it quite well ;) I have not the time right now to do it, but if it turns out to be useful, I can show why I came to the patterns I sent to the list. Thanks, Tiago. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor