Re: Please help with regular expression finding multiple floats

2009-10-26 Thread Jeremy
On Oct 24, 12:00 am, Edward Dolan wrote: > No, you're not missing a thing. I am ;) Something was happening with > the triple-quoted > strings when I pasted them. Here is hopefully, the correct > code.http://codepad.org/OIazr9lA > The output is shown on that page as well. > > Sorry for the line no

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Edward Dolan
No, you're not missing a thing. I am ;) Something was happening with the triple-quoted strings when I pasted them. Here is hopefully, the correct code. http://codepad.org/OIazr9lA The output is shown on that page as well. Sorry for the line noise folks. One of these days I'm going to learn gnus. -

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Jeremy
On Oct 23, 3:48 am, Edward Dolan wrote: > On Oct 22, 3:26 pm, Jeremy wrote: > > > My question is, how can I use regular expressions to find two OR three > > or even an arbitrary number of floats without repeating %s?  Is this > > possible? > > > Thanks, > > Jeremy > > Any time you have tabular da

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Edward Dolan
I can see why this line could wrap > 1.E-08 1.58024E-06 0.0048 1.E-08 1.58024E-06 > 0.0048 But this one? > 1.E-07 2.98403E-05 > 0.0018 anyway, here is the code -> http://codepad.org/Z7eWBusl -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Edward Dolan
On Oct 22, 3:26 pm, Jeremy wrote: > My question is, how can I use regular expressions to find two OR three > or even an arbitrary number of floats without repeating %s?  Is this > possible? > > Thanks, > Jeremy Any time you have tabular data such as your example, split() is generally the first ch

Re: Please help with regular expression finding multiple floats

2009-10-22 Thread Cousin Stanley
> I have text that looks like the following > (but all in one string with '\n' separating the lines): > > > I want to capture the two or three floating point numbers in each line > and store them in a tuple. > > I have the regular expression pattern > Jeremy For a non-r

Re: Please help with regular expression finding multiple floats

2009-10-22 Thread Rhodri James
On Thu, 22 Oct 2009 23:26:01 +0100, Jeremy wrote: I have text that looks like the following (but all in one string with '\n' separating the lines): 1.E-08 1.58024E-06 0.0048 [snip] 5.E+00 2.42717E-05 0.0017 total 1.93417E-04 0.0012 I want to capture the two or

Please help with regular expression finding multiple floats

2009-10-22 Thread Jeremy
I have text that looks like the following (but all in one string with '\n' separating the lines): 1.E-08 1.58024E-06 0.0048 1.E-07 2.98403E-05 0.0018 1.E-06 8.85470E-06 0.0026 1.E-05 6.08120E-06 0.0032 1.E-03 1.61817E-05 0.0022 1.E+00 8.3