<div dir="ltr"><div>Thanks everybody , and especially Chris - i used split and it took me 15 mins to make it work :)</div>
<div><br>The final version looks like:</div>
<div> </div>
<div>from datetime import datetime, date, time<br>today_day = datetime.now()<br>time_tuple= today_day.timetuple()<br>hhh = open("file_with_data.data",'r')<br>for nnn in hhh:<br>    if nnn.split()[2] == str(time_tuple[1]).strip(' \t\n\r')   and  nnn.split()[4]  == str(time_tuple[0]).strip(' \t\n\r') and  nnn.split()[3] == str(time_tuple[2]).strip(' \t\n\r')   :</div>

<div>             print nnn<br></div>
<div> </div>
<div>Cheers and good day everyone</div>
<div>Yuri</div>
<div>        </div>
<div class="gmail_quote">On Tue, Apr 12, 2011 at 8:58 AM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">On Mon, Apr 11, 2011 at 10:20 PM, Yuri Slobodyanyuk<br><<a href="mailto:yuri.slobodyanyuk@gmail.com">yuri.slobodyanyuk@gmail.com</a>> wrote:<br></div>
<div class="im">> Good day everyone,<br>> I am trying to make this pretty simple regex to work but got stuck,<br>> I'd appreciate your help .<br><br></div>"Some people, when confronted with a problem, think 'I know, I'll use<br>
regular expressions.' Now they have two problems."<br><br><snip><br>
<div class="im">> 1111111 Fri 4  8 2011<br>> 2323232 Fri 4 15 2011<br>> 4343434 Fri 4 22 2011<br>> 8522298 Fri 4 29 2011<br>> .........<br>> 5456678 Fri 10 28 2011<br>> 5633333 Fri 11  4 2011<br>> 4141411 Fri 11 11 2011<br>
> 3324444 Fri 11 18 2011<br><br></div>There's no need to use regexes to parse such a simple file format.<br>Just use str.split() [without any arguments] on each line of the file,<br>and do the field equality checks yourself; your code will simpler.<br>
Relevant docs: <a href="http://docs.python.org/library/stdtypes.html#str.split" target="_blank">http://docs.python.org/library/stdtypes.html#str.split</a><br>
<div>
<div></div>
<div class="h5"><br>Cheers,<br>Chris<br>--<br><a href="http://blog.rebertia.com/" target="_blank">http://blog.rebertia.com</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>
<div dir="ltr">
<div>Taking challenges one by one.</div>
<div><a href="http://yurisk.info/" target="_blank">http://yurisk.info</a></div>
<div><a href="http://ccie-security-blog.com/" target="_blank">http://ccie-security-blog.com</a></div>
<div> </div>
<div> </div></div><br></div>