For example, if I want to match an img that contains a class attribute, and get the value of the class, whether it is regular or not, it starts with <img and ends with />, contains the class attribute in the middle, and ignores other attributes in the middle.
<img alt="HD" id="av" src="a.jpg"'/>
The answer is as follows:
<img.*?class="(.*?)".*?\/?>