HI Tim,<br>
<br>
oof!<br>
thats true!<br>
<br>
thanks a lot.<br>
Is there any tool to simplify building the regex  ?<br>
<br>
regards,<br>
KM<br><br><div><span class="gmail_quote">On 11/23/06, <b class="gmail_sendername">Tim Chase</b> <<a href="mailto:python.list@tim.thechases.com">python.list@tim.thechases.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> line is am trying to match is<br>>
1959400|Q2BYK3|Q2BYK3_9GAMM Hypothetical outer
membra    29.9    0.00011  
1<br>><br>> regex i have written is<br>> re.compile<br>> (r'(\d+?)\|((P|O|Q)\w{5})\|\w{3,6}\_\w{3,5}\s+?.{25}\s{3}(\d+?\.\d)\s+?(\d\.\d+?)')<br>><br>> I am trying to extract 0.0011 value from the above line.
<br>> why doesnt it match the group(4) item of the match ?<br>><br>> any idea whats wrong  with it ?<br><br>Well, your ".{25}\s{3}" portion only gets you to one space short<br>of your 29.9, so your "(\d+..." fails to match " 
29.9" because<br>there's an extra space there.  My guess (from only one datum, so<br>this could be /way/ off base) would be that you mean "\s{4}" or<br>possibly "\s{3,4}"<br><br>It seems like a very overconstrained regexp, but it might be just
<br>what you need to isolate the single line (or class of line)<br>amongst the chaff of thousand others of similar form.<br><br>-tkc<br><br><br><br><br><br></blockquote></div><br>