I'm looking for a Regex that would remove all the white spaces from html code present in .aspx file. Here are some of the conditions that the Regex should satisfy:
- Whitespaces between strings enclosed between "" or '' should not be removed.
- Whitespaces between html attributes/tags, for example like
<a href>text1 text2</a>
, should not be removed. Html can also start with<!
in case of doctype specification. In short, only Whitespaces that appear after a html tag needs to be removed. - Whitespaces between server tags enclosed between <% %>, should not be removed.
If you would be able to provide one single Regex that satisfies all the above condition, it would be great. Otherwise, separate Regex is also fine.
Thanks in advance.