<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hello,<BR>
&nbsp;<BR>
For a exerise I made this one :"<BR>
&nbsp;<BR>
import string<BR>
def extract_words(s):<BR>&nbsp;&nbsp;&nbsp; """<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&gt; extract_words('Now is the time!&nbsp; "Now", is the time? Yes, now.')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ['now', 'is', 'the', 'time', 'now', 'is', 'the', 'time', 'yes', 'now']<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;&gt;&gt; extract_words('she tried to curtsey as she spoke--fancy')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ['she', 'tried', 'to', 'curtsey', 'as', 'she', 'spoke', 'fancy']<BR>&nbsp;&nbsp;&nbsp; """<BR>&nbsp;&nbsp;&nbsp; word= ""<BR>&nbsp;&nbsp;&nbsp; s=string.lower(s)<BR>&nbsp;&nbsp;&nbsp; for char in s :<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ord(char) &gt;=65 and ord(char) &lt;= 122 or ord(char)==32 or ord(char)==45:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; word= word + char <BR>&nbsp;&nbsp;&nbsp; word=string.split(word, "--")<BR>&nbsp;&nbsp;&nbsp; word=string.join(word, " ")<BR>&nbsp;&nbsp;&nbsp; word=word.replace ("&nbsp; ", " ")<BR>&nbsp;&nbsp;&nbsp; word=string.split(word, " ")<BR>&nbsp;&nbsp;&nbsp; return word<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>if __name__ == '__main__':<BR>&nbsp;&nbsp;&nbsp; import doctest<BR>&nbsp;&nbsp;&nbsp; doctest.testmod()<BR>
&nbsp;<BR>
But now I wonder if this can be done more easerly ?<BR>
&nbsp;<BR>
Roelof<BR>
&nbsp;<BR>                                               </body>
</html>