Re: Text parsing via regex

2008-12-09 Thread rdmurray
On Mon, 8 Dec 2008 at 16:51, Robert Kern wrote: Robocop wrote: Wow! Thanks for all the input, it looks like that textwrapper will work great for my needs. And thanks for the regex help everyone. Also, i was thinking of using a list, but i haven't used them much in python. Is there

Text parsing via regex

2008-12-08 Thread Robocop
I'm having a little text parsing problem that i think would be really quick to troubleshoot for someone more versed in python and Regexes. I need to write a simple script that parses some arbitrarily long string every 50 characters, and does not parse text in the middle of words (but ultimately

Re: Text parsing via regex

2008-12-08 Thread r0g
Robocop wrote: I'm having a little text parsing problem that i think would be really quick to troubleshoot for someone more versed in python and Regexes. I need to write a simple script that parses some arbitrarily long string every 50 characters, and does not parse text in the middle of

Re: Text parsing via regex

2008-12-08 Thread Paul McGuire
On Dec 8, 12:13 pm, Robocop [EMAIL PROTECTED] wrote: I'm having a little text parsing problem that i think would be really quick to troubleshoot for someone more versed in python and Regexes. I need to write a simple script that parses some arbitrarily long string every 50 characters, and does

Re: Text parsing via regex

2008-12-08 Thread I V
On Mon, 08 Dec 2008 13:42:00 -0500, r0g wrote: Robocop wrote: However i'm having several problems. I know that playskool regular expression i wrote above will only parse every 50 characters, and will blindly cut words in half if the parsed string doesn't end with a whitespace. I'm

Re: Text parsing via regex

2008-12-08 Thread Shane Geiger
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/148061 def wrap(text, width): A word-wrap function that preserves existing line breaks and most spaces in the text. Expects that existing line breaks are posix newlines (\n). return reduce(lambda line, word,

Re: Text parsing via regex

2008-12-08 Thread Vlastimil Brom
2008/12/8 Robocop [EMAIL PROTECTED]: I'm having a little text parsing problem that i think would be really quick to troubleshoot for someone more versed in python and Regexes. I need to write a simple script that parses some arbitrarily long string every 50 characters, and does not parse text

Re: Text parsing via regex

2008-12-08 Thread MRAB
Paul McGuire wrote: On Dec 8, 12:13 pm, Robocop [EMAIL PROTECTED] wrote: I'm having a little text parsing problem that i think would be really quick to troubleshoot for someone more versed in python and Regexes. I need to write a simple script that parses some arbitrarily long string every 50

Re: Text parsing via regex

2008-12-08 Thread MRAB
Vlastimil Brom wrote: 2008/12/8 Robocop [EMAIL PROTECTED]: I'm having a little text parsing problem that i think would be really quick to troubleshoot for someone more versed in python and Regexes. I need to write a simple script that parses some arbitrarily long string every 50 characters, and

Re: Text parsing via regex

2008-12-08 Thread Robocop
Wow! Thanks for all the input, it looks like that textwrapper will work great for my needs. And thanks for the regex help everyone. Also, i was thinking of using a list, but i haven't used them much in python. Is there anything in python that is equivalent to pushback in c++ for vectors? As in,

Re: Text parsing via regex

2008-12-08 Thread Robert Kern
Robocop wrote: Wow! Thanks for all the input, it looks like that textwrapper will work great for my needs. And thanks for the regex help everyone. Also, i was thinking of using a list, but i haven't used them much in python. Is there anything in python that is equivalent to pushback in c++