[Tutor] how to remove html ags

anil maran anilmrn at yahoo.com
Mon Aug 14 22:27:05 CEST 2006


how to do regular expressions
and remove waht is in and also the brackets
<>

Kent Johnson <kent37 at tds.net> wrote: anil maran wrote:
> 
Human nature is not a machin... 
> 
>
> for example in the above stirng
>
> i want to remove 
> and 

Try one of these:
http://www.oluyede.org/blog/2006/02/13/html-stripper/
http://www.aminus.org/rbre/python/cleanhtml.py
>
> i tried
>
> str = str.replace('(.*)','')
>
> it doesnt work
because it looks for a literal "(.*)" in the string and replaces it with 
an empty string. Since "(.*)" doesn't appear, nothing is replaced.

Kent
> thanks
>
> ------------------------------------------------------------------------
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great 
> rates starting at 1¢/min. 
>  
>
>
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>  


_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor




 		
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060814/f9b9b230/attachment-0001.htm 


More information about the Tutor mailing list