[thelist] no more font tags?

Bob Davis bobd at members.evolt.org
Sat Jun 2 09:41:51 CDT 2001


A better expression is this one:
	
	<[\/]*[font|FONT][^>]*>

It will take care of end tags as well. Note that using * (0 or more) 
instead of + (1 or more) is needed here because opening tags don't have 
the leading / and closing tags don't have anything between "font" and 
the >.

It also takes upper case and lower case into account.

I use it all the time in BBEdit (so ymmv with other regex engines).

So...

<tip type="BBEdit regular expression for cleaning font tags" author="bob 
davis">

The following will match opening and closing font tags (<font> and 
</font>) with any attributes, written in upper case or lower case. Leave 
the "Replace with" field empty to just kill all of your font tags. It's 
super useful for cleaning up MS Word generated HTML.

	<[\/]*[font|FONT][^>]*>

It's a good pattern to save (make sure "Use grep" is on!).

</tip>

bob


On Saturday, June 2, 2001, at 10:25 AM, Michael Barrett wrote:

> <tip type="addon">
> In Dreamweaver's search and replace dialogue, check "Use Regular
> Expressions"
> Then enter "<font[^>]+>" to search for all instances of an opening font 
> tag.
> Of course replace the mess with nothing.
> Then a simple search and replace for the end tag, "</font>" will clean 
> out
> the rest.
> This also works in BBEdit's search and replace feature, you would check 
> "Use
> Grep" instead.
> </tip>


--
bob davis
bobd at members.evolt.org




More information about the thelist mailing list