Making HTML smaller by removing redundant boolean property values

Boolean properties of HTML elements needed to contain a string value in XHMTL, but while in HTML5, unnecessary weight on the document.

A boolean attribute is one that needs no declared value.

Regular expression for finding such properties.

 (\w+)="\1"

Replace with &1.

Example

<input required="required"/>
<option selected="selected" multiple="multiple"></option>

Becomes

<input required/>
<option selected multiple></option>

Another, space before self closing.

\s+\/>

Replace with />

Example

<input />
<img />

Becomes

<input/>
<img/>

Additional reduction could be achieved by removing the closing slash from above examples. Arguments on doing so can be read further from colorglare.com.