Sorry, if I missed some further specification in the earlier thread or
if the following is oversimplification of the original problem (using
3 numbers instead of 32),
would something like the following work for your data?
import re
data = 2.201000e+01 2.15e+01 2.199000e+01 : (instance: 0)
Hi Josh,
thanks for the reply. I am no expert so please bear with me:
I thought that the {32} was supposed to match the previous expression 32
times?
So how can i have all matches accessible to me?
matt
On Thursday, August 18, 2011, Josh Benner wrote:
On Thu, Aug 18, 2011 at 4:03 PM, Matt
Hi Josh,
thanks for the reply. I am no expert so please bear with me:
I thought that the {32} was supposed to match the previous expression 32
times?
So how can i have all matches accessible to me?
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type help,
Hi,
thanks for the suggestion. I guess i had found another way around the
problem as well. But i really wanted to match the line exactly and i
wanted to know why it doesn't work. That is less for the purpose of
getting the thing to work but more because it greatly annoys me off that
i can't figure
On 19 août, 17:20, Matt Funk matze...@gmail.com wrote:
Hi,
thanks for the suggestion. I guess i had found another way around the
problem as well. But i really wanted to match the line exactly and i
wanted to know why it doesn't work. That is less for the purpose of
getting the thing to work
Matt Funk matze...@gmail.com writes:
thanks for the suggestion. I guess i had found another way around the
problem as well. But i really wanted to match the line exactly and i
wanted to know why it doesn't work. That is less for the purpose of
getting the thing to work but more because it
On Friday, August 19, 2011, Alain Ketterlin wrote:
Matt Funk matze...@gmail.com writes:
thanks for the suggestion. I guess i had found another way around the
problem as well. But i really wanted to match the line exactly and i
wanted to know why it doesn't work. That is less for the purpose
On 19 août, 19:33, Matt Funk matze...@gmail.com wrote:
The results obtained are:
results:
[(' 2.199000e+01', ' : (instance: 0)\t:\tsome description')]
so this matches the last number plus the string at the end of the line, but no
retaining the previous numbers.
Anyway, i think at this
On 08/19/2011 11:33 AM, Matt Funk wrote:
On Friday, August 19, 2011, Alain Ketterlin wrote:
Matt Funk matze...@gmail.com writes:
thanks for the suggestion. I guess i had found another way around the
problem as well. But i really wanted to match the line exactly and i
wanted to know why it
On Friday, August 19, 2011 10:33:49 AM UTC-7, Matt Funk wrote:
number = r\d\.\d+e\+\d+
numbersequence = r%s( %s){31}(.+) % (number,number)
instance_linetype_pattern = re.compile(numbersequence)
The results obtained are:
results:
[(' 2.199000e+01', ' : (instance: 0)\t:\tsome description')]
On 19/08/2011 20:55, ru...@yahoo.com wrote:
On 08/19/2011 11:33 AM, Matt Funk wrote:
On Friday, August 19, 2011, Alain Ketterlin wrote:
Matt Funkmatze...@gmail.com writes:
thanks for the suggestion. I guess i had found another way around the
problem as well. But i really wanted to match the
On Friday, August 19, 2011, jmfauth wrote:
On 19 août, 19:33, Matt Funk matze...@gmail.com wrote:
The results obtained are:
results:
[(' 2.199000e+01', ' : (instance: 0)\t:\tsome description')]
so this matches the last number plus the string at the end of the line,
but no retaining the
On Friday, August 19, 2011, Carl Banks wrote:
On Friday, August 19, 2011 10:33:49 AM UTC-7, Matt Funk wrote:
number = r\d\.\d+e\+\d+
numbersequence = r%s( %s){31}(.+) % (number,number)
instance_linetype_pattern = re.compile(numbersequence)
The results obtained are:
results:
[('
Hi,
i am sorry if this doesn't quite match the subject of the list. If someone
takes offense please point me to where this question should go. Anyway, i have
a problem using regular expressions. I would like to match the line:
1.002000e+01 2.037000e+01 2.128000e+01 1.908000e+01 1.871000e+01
You don't seem to account for the whitespace between the floats. Try
'([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?\s+){32}'
(just added \s+).
Martin
On 8/18/2011 9:49 PM, Matt Funk wrote:
Hi,
i am sorry if this doesn't quite match the subject of the list. If someone
takes offense please point
In mailman.191.1313697016.27778.python-l...@python.org Matt Funk
matze...@gmail.com writes:
1.002000e+01 2.037000e+01 2.128000e+01 1.908000e+01 1.871000e+01 1.914000e+01
instance_linetype_pattern_str = '([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?)
{32}'
instance_linetype_pattern =
2011/8/18 Matt Funk matze...@gmail.com:
Hi,
i am sorry if this doesn't quite match the subject of the list. If someone
takes offense please point me to where this question should go. Anyway, i have
a problem using regular expressions. I would like to match the line:
1.002000e+01 2.037000e+01
Hi guys,
thanks for the suggestions. I had tried the white space before as well (to no
avail). So here is the expression i am using (based on suggestions), but still
no success:
instance_linetype_pattern_str =\
r'(([-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+))?\s+){32}(.+)'
On Thu, Aug 18, 2011 at 4:03 PM, Matt Funk matze...@gmail.com wrote:
Hi guys,
thanks for the suggestions. I had tried the white space before as well (to
no
avail). So here is the expression i am using (based on suggestions), but
still
no success:
instance_linetype_pattern_str =\
19 matches
Mail list logo