Skip to content

Instantly share code, notes, and snippets.

@DaveEveritt
Created July 25, 2010 09:31
Show Gist options
  • Save DaveEveritt/489445 to your computer and use it in GitHub Desktop.
Save DaveEveritt/489445 to your computer and use it in GitHub Desktop.
regex to fix unquoted html/xhtml width/height attributes

Simple-as-possible regular expression to fix unquoted html/xhtml width/height attributes:

find: (width|height)=([\d]+)

replace: $1="$2"

Example result:

find: <img src="myimage.png" height=20 width=200 />

replace: <img src="myimage.png" height="20" width="200" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment