interessante...<br><br><div class="gmail_quote">Il giorno 28 luglio 2012 23:05, Marco Beri <span dir="ltr"><<a href="mailto:marcoberi@gmail.com" target="_blank">marcoberi@gmail.com</a>></span> ha scritto:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF"><div><br></div><div>Il giorno 28/lug/2012, alle ore 22:40, Daniele Varrazzo <<a href="mailto:piro@develer.com" target="_blank">piro@develer.com</a>> ha scritto:</div><div class="im"><div><br></div>
<blockquote type="cite">
<div><span>No, anzi, grazie per questo capolavoro!</span><br></div></blockquote><br></div><div>E allora mi sento in dovere di copia-incollare il paragrafo di un famosissimo libro :-)</div><div><br></div><div>Ciao.</div><div>
Marco.</div>
<div><br></div><div><br></div><div title="Page 187"><div><div>
                                        <p><span>Ma.attenzione.a.non.esagerare!
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">Esiste un detto famoso riguardante le regular expression:
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad';font-style:italic">Un tizio aveva un problema e disse "So come risolverlo: userò una regular
expression!". E così il tizio ebbe due problemi...
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">Non crediamo che sia così, però bisogna fare attenzione a usare le re-
gular expression per quello che sono, senza esagerare.
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">Come ultimo esempio vogliamo dare un'occhiata a una regular ex-
pression che forse non rispetta il consiglio di non esagerare.
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">Si tratta di una regular expression che controlla la correttezza di un
indirizzo email:
</span></p>
                                        <pre><span style="font-size:8.000000pt;font-family:'MCPdigital'">   ^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|/|=|\?|\^|_|`|
   \{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|/|
   =|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]
   |[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-
   z]|[0-9]|\-){0,61}([a-z]|[0-9])\.(af|ax|al|dz|as|ad
   |ao|ai|aq|ag|ar|am|aw|au|at|az|bs|bh|bd|bb|by|be|bz
   |bj|bm|bt|bo|ba|bw|bv|br|io|bn|bg|bf|bi|kh|cm|ca|cv
   |ky|cf|td|cl|cn|cx|cc|co|km|cg|cd|ck|cr|ci|hr|cu|cy
   |cz|dk|dj|dm|do|ec|eg|sv|gq|er|ee|et|fk|fo|fj|fi|fr
   |gf|pf|tf|ga|gm|ge|de|gh|gi|gr|gl|gd|gp|gu|gt|gg|gn
   |gw|gy|ht|hm|va|hn|hk|hu|is|in|id|ir|iq|ie|im|il|it
   |jm|jp|je|jo|kz|ke|ki|kp|kr|kw|kg|la|lv|lb|ls|lr|ly
   |li|lt|lu|mo|mk|mg|mw|my|mv|ml|mt|mh|mq|mr|mu|yt|mx
   |fm|md|mc|mn|ms|ma|mz|mm|na|nr|np|nl|an|nc|nz|ni|ne
   |ng|nu|nf|mp|no|om|pk|pw|ps|pa|pg|py|pe|ph|pn|pl|pt
   |pr|qa|re|ro|ru|rw|sh|kn|lc|pm|vc|ws|sm|st|sa|sn|cs
   |sc|sl|sg|sk|si|sb|so|za|gs|es|lk|sd|sr|sj|sz|se|ch
   |sy|tw|tj|tz|th|tl|tg|tk|to|tt|tn|tr|tm|tc|tv|ug|ua
   |ae|gb|us|um|uy|uz|vu|ve|vn|vg|vi|wf|eh|ye|zm|zw|co
   m|edu|gov|int|mil|net|org|biz|info|name|pro|aero|co</span><span>op </span></pre><pre><span>   |museum|arpa))|(((([0-9]){1,3}\.){3}([0-9]){1,3})</span></pre>
<pre><span style="font-size:8.000000pt;font-family:'MCPdigital'"><div title="Page 188">
                        <div>
                                <div>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">1   Appendice B
</span></p>
                                </div>
                        </div>
                        <img src="cid:/page188image1196" alt="page188image1196" height="0.500000" width="275.460999">
                        </div></span><span style="font-size:8.000000pt;font-family:'MCPdigital'"><div title="Page 188"><div>
                                </div></div></span><span style="font-size:8.000000pt;font-family:'MCPdigital'"><div title="Page 188"><div><div>
                                        <pre><span style="font-size:8.000000pt;font-family:'MCPdigital'">   )|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$
</span></pre>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad';font-style:italic">Questo capolavoro di ingegnosità (e di costanza) è dovuto ad
un certo Philippe Benthien che l'ha inserito nel sito </span><span style="font-size:8.000000pt;font-family:'MCPdigital'"><a href="http://re-" target="_blank">http://re-</a>
<a href="http://gexlib.com" target="_blank">gexlib.com</a>
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">Siamo sicuri che questa regular expression controlla alla perfezione la
correttezza formale di un indirizzo email.
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad'">Però se il signor Mario Rossi, il cui indirizzo è </span><span style="font-size:8.000000pt;font-family:'MCPdigital'"><a href="mailto:mario.rossi@posta.it" target="_blank">mario.rossi@posta.it</a>
</span><span style="font-size:10.000000pt;font-family:'Myriad'">scrivesse per errore </span><span style="font-size:8.000000pt;font-family:'MCPdigital'"><a href="mailto:mario.risso@posta.it" target="_blank">mario.risso@posta.it</a>, </span><span style="font-size:10.000000pt;font-family:'Myriad'">la regular expression non
gli direbbe che ha sbagliato. Viceversa il signor John Smith. il cui indi-
rizzo email è </span><span style="font-size:8.000000pt;font-family:'MCPdigital'"><a href="mailto:john.smith@people.mobi" target="_blank">john.smith@people.mobi</a>, </span><span style="font-size:10.000000pt;font-family:'Myriad'">non potrebbe inserire il suo
indirizzo se il controllo fosse affidato a questa regular expression...
</span></p>
                                        <p><span style="font-size:10.000000pt;font-family:'Myriad';font-style:italic">Per la cronaca </span><span style="font-size:8.000000pt;font-family:'MCPdigital'">.mobi </span><span style="font-size:10.000000pt;font-family:'Myriad';font-style:italic">è un dominio di primo livello introdotto nel 2006.
</span></p><br></div></div></div></span></pre>
                                </div>
                        </div>
                </div></div>
<br>_______________________________________________<br>
Python mailing list<br>
<a href="mailto:Python@lists.python.it">Python@lists.python.it</a><br>
<a href="http://lists.python.it/mailman/listinfo/python" target="_blank">http://lists.python.it/mailman/listinfo/python</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Quiero ser el rayo de sol que cada día te despierta<br>para hacerte respirar y vivir en me.<br>"Favola -Moda".<br>