REGEX – Find all CSS attributes

This regexp will find CSS attributes, such as background:red; or padding-left:25px;.


\s(?[a-zA-Z-]+)\s[:]{1}\s*(?[a-zA-Z0-9\s.#]+)[;]{1}

Leave a Reply

Your email address will not be published. Required fields are marked *

*