I made this regex to get all attributes in tag "img".
 /<img\s+(?:([a-z_-]+)\s*=\s*"(.*?)"\s*)*\s*\/>/g
But, It just take only one attribute which is last.
How can I get all attributes with regex?
Test String:
 <img src="abc.png" alt="abc" />
 <img alt="def" src="def.png" />
 <img src="abc.png" alt="abc" style="border:none" />
 <img alt="def" src="def.png" style="border:none" />
Result: (with http://www.regex101.com)
 MATCH 1
 1. [19-22] `alt`
 2. [24-27] `abc`
 MATCH 2
 1. [47-50] `src`
 2. [52-59] `def.png`
 MATCH 3
 1. [93-98] `style`
 2. [100-111]   `border:none`
 MATCH 4
 1. [145-150]   `style`
 2. [152-163]   `border:none`
 
     
    