Sandro,<div> Thanks very much for your response.</div><div><br></div><div>Regarding the difference between the 2.6 and 2.7 documentation, indeed you're correct. I should have sent this link instead :<div><br></div><div>
<a href="http://docs.python.org/release/2.6/library/re.html#re.compile">http://docs.python.org/release/2.6/library/re.html#re.compile</a></div><div><br></div><div>However the text that I'm referring to is identical in the 2.7 and 2.6 docs.</div>
<div><br></div><div>If the intent of this part of the doc is "to give a clue, mentioning the most commonly used<br>methods" I would recommend changing the language from :</div><div><br></div><div>"Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods, described below."<br>
<br></div><div>which is very specific to something like :</div><div><br></div><div>"Compile a regular expression pattern into a regular expression object, which can be used for matching using methods such as match() and search(), described below."<br>
</div><div><br></div><div>which conveys that "match" and "search" are merely the most commonly used methods and that all methods apply. The existing method implies those 2 methods specifically.</div><div>
<br></div><div>-Gene</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Wed, Aug 24, 2011 at 3:19 PM, Sandro Tosi <span dir="ltr"><<a href="mailto:sandro.tosi@gmail.com">sandro.tosi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Gene,<br>
thanks for your email.<br>
<div class="im"><br>
On Wed, Aug 24, 2011 at 07:19, Gene Wood <<a href="mailto:gene_wood@cementhorizon.com">gene_wood@cementhorizon.com</a>> wrote:<br>
> <a href="http://docs.python.org/library/re.html#re.compile" target="_blank">http://docs.python.org/library/re.html#re.compile</a><br>
> The doc says : "Compile a regular expression pattern into a regular<br>
> expression object, which can be used for matching using its match() and<br>
> search() methods, described below."<br>
> However if you do a dir of the resulting object under python 2.6 the object<br>
> actually supports all of the methods listed in the doc.<br>
> I went around trying to figure out how I was going to upgrade to python 2.7<br>
> in order to do a multiline "subn" regex and then found a <a href="http://stackoverflow.com" target="_blank">stackoverflow.com</a><br>
> answer that indicated you could call "subn" from this object. I then did a<br>
> dir on the object and found it supported all the methods.<br>
<br>
</div>Just let me clarify one thing first: the link you mentioned at the<br>
beginning of the email is referring to python 2.7, so trying to match<br>
that documentation against 2.6 can results in some incongruences and<br>
ambiguities. If you're working on 2.6 (even thought we suggest to<br>
upgrade to the latest supported version, 2.7 in this case) you may<br>
want to refer to the 2.6-specific documentation:<br>
<a href="http://docs.python.org/release/2.6/" target="_blank">http://docs.python.org/release/2.6/</a><br>
<div class="im"><br>
> I suggest you change the doc to either say :<br>
> "Compile a regular expression pattern into a regular expression object,<br>
> which can be used for matching using its match(), search(), split(),<br>
> findall(), finditer(), sub() and subn() methods, described below."<br>
> or<br>
> "Compile a regular expression pattern into a regular expression object,<br>
> which can be used for matching using any of the methods described below."<br>
<br>
</div>With that said above, I don't think the documentation should list all<br>
the available methods form the resulting object. What I think the doc<br>
is trying to do is to give a clue, mentioning the most commonly used<br>
methods.<br>
<br>
Regards,<br>
<font color="#888888">--<br>
Sandro Tosi (aka morph, morpheus, matrixhasu)<br>
My website: <a href="http://matrixhasu.altervista.org/" target="_blank">http://matrixhasu.altervista.org/</a><br>
Me at Debian: <a href="http://wiki.debian.org/SandroTosi" target="_blank">http://wiki.debian.org/SandroTosi</a><br>
</font></blockquote></div><br></div></div>