<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt">'match' requires starting from the start of the string.  `line` starts with a tab which is not in the pattern.  I think you want re.search (which does not imply anchor at the beginning the way re.match does).<br>
<br>Alex<br><br><div class="gmail_quote">On Thu, Nov 29, 2012 at 10:57 AM, Mitch Patenaude <span dir="ltr"><<a href="mailto:patenaude@gmail.com" target="_blank">patenaude@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Maybe I'm misunderstanding, but I think I have a bug in the re module:<div><div>mpatenaude-mbp:tmp mpatenaude$ python2.7</div><div>Python 2.7.3 (default, Apr 13 2012, 00:05:08) </div><div>[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin</div>

<div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import re</div><div>>>> line="\tTest2.1\n"</div><div>>>> matchobj = re.match('Test2.1',line,0)</div>

<div>>>> matchobj</div><div></div></div><div><br></div><div>It's not matching a very simple string.</div><div><br></div><div>(I know that '.' is a special character, but it should match any character, including a period itself, so I didn't bother to escape it.)</div>

<div><br></div><div>It *works* if I use findall rather than match, but I don't understand why.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>  -- Mitch</div>
</font></span><br>_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="http://mail.python.org/mailman/listinfo/baypiggies" target="_blank">http://mail.python.org/mailman/listinfo/baypiggies</a><br></blockquote></div><br></div>