batch parenthesis matching

batch parenthesis matching

Tzafrir Cohen tzafrir at cohens.org.il
Thu Aug 6 20:51:04 IDT 2009


On Thu, Aug 06, 2009 at 06:55:16PM +0300, Erez D wrote:
> hi
> 
> i have an html file with few different instances of:
> 
> 
> <span class="myclass">
> ... some html, e.g. <B> blah blah <a href=....> </a> </b>
> </span>
> 
> 
> i want to remove theses instances.
> ( the html inside the <span> varies between instances, and there is a non
> constant number of instances)
> 
> i thought of replacing '<[^/]' (i.e. '<' folowed by somthing else then '/' )
> with '{' and '</' with '}' and then doing parenthesis matching
> however i need it done automatically in batch. (i can do parenthesis
> matching in vi. can i do this in sed ?)

Maybe. But if the page is complex enough, you need a proper HTML parser.


-- 
Tzafrir Cohen         | tzafrir at jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir at cohens.org.il |                    |  best
ICQ# 16849754         |                    | friend



More information about the Linux-il mailing list