Parsing a string based on specified identifiers?

Not terribly elegant but it works: s 'one aaa two bbbb three cccc' >>> re. Split(r"\s*(?:one|two|three)\s*", s) '', 'aaa', 'bbbb', 'cccc' The? : keeps it from returning the delimiting identifiers in the results.

Not terribly elegant but it works: >>> s 'one aaa two bbbb three cccc' >>> re. Split(r"\s*(?:one|two|three)\s*", s) '', 'aaa', 'bbbb', 'cccc' The? : keeps it from returning the delimiting identifiers in the results.

I think this is a decent solution. Thank you. – jml May 11 '10 at 23:10.

So, so ugly, but it should do what you need: i1 = iter(input.split()) i2 = iter(input.split()) next(i2) strdict = dict(zip(i1, i2)) print operator. Itemgetter(*criteria)(strdict).

Very cool. I don't think it's that ugly! I mean; consider this being done in c.

:) – jml May 11 '10 at 23:11.

Keeps it from returning the delimiting identifiers in the results. Terms of service. Not the answer you're looking for?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions