<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br><br><div>> <br>> RTFM :)<br><br>TFM has been Read b4 starting the project :P<br><br>> http://docs.python.org/library/re.html#matching-vs-searching<br>> <br>> specifically:<br>> where are these numbers on each line? Are they at the start? if not,<br>> re.match won't find them without a preceding wildcard.<br><br>yes there are one each line and at the start of each <br> <br>> Also, there's no need for the 'this=...' bit, unless you actually feel<br>> you need the variable.<br><br>yes I need "this" as variable even though it has a different variable name in the source code.<br> <br>> Something like the following<br>> <br>> for line in open('filename'):<br>> if re.search('1000[01]', line):<br>> print line<br><br> <br>> is more likely to succeed<br><br>YES True, but there are 10.000 different digit numbers, but I only need to find 10 numbers .. such as 10000, 10001, 1286, 3412, 3512, 456, 653,,,etc and they are different. Therefore I need to retrieve one out of these 10 numbers ! <br>> <br>> > /*It doesn't give me any errors. However; doesn't find the 10000 OR 10001 */<br>> As Tet says, that's difficult to credit, unless you have selectively<br>> copied and pasted random bits of your code into this email and changed<br>> the quoting. Or just attempted to write it in email from memory.<br><br>copy and paste doesn't work due to my platform environment settings ! I have typed some part and yes I missed some syntax !<br>> At the very least:<br>> <br>> * the 'r' on your open(...) line is not quoted<br>> * The re.match line itself will throw at least one syntax error - all<br>> characters in your pattern should be inside one set of quotes.<br><br>yes True but using DrPython as an editor won't let you to save the code if you have syntax issues.<br><br>> * The second if statement is missing a colon.<br>> <br>> This example was fairly trivial, but if you are asking for help with<br>> code like this, it would help if you actually post working excerpts from<br>> it. Or excerpts that throw the errors you are asking about.<br><br>agree and thank you :)<br><br>> Regards,<br>> <br>> Stuart<br>> -- <br>> Stuart Sears RHCA etc.<br>> "It's today!" said Piglet.<br>> "My favourite day," said Pooh.<br>> --<br>> Gllug mailing list - Gllug@gllug.org.uk<br>> http://lists.gllug.org.uk/mailman/listinfo/gllug<br></div> </div></body>
</html>