[thelist] tip: zapping tags to XHTML w/grep

Joseph A Borg jacborg at mac.com
Mon Jun 10 10:00:00 CDT 2002


since I owe a lot of tips, here's one for starters. I hope someone finds
it useful...

<tip type="BBEdit Lite: terminating nonempty elements" author="Joseph A
Borg">

by entering the following string in BBEdit's find box (make sure to tick
'Use Grep')
	<(meta|img|br|area|hr)([^>]+)([^/]>)

and the following in the replace:
	\1\2 />

You can jolt the meta, img, br, hr, area tags to xhtml validation.
Grooming after old visual editors.

NB any tags that might already be closed are ignored

NB2 BBEdit's grepping engine is a variant of Henry Spencer's regexp
package

</tip>




More information about the thelist mailing list