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

Joseph A Borg thelist at lists.evolt.org
Mon Jun 10 10:25:01 2002


OPS! forgot to open the replace field with <

1000 apologies!

<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>