(<img.*?)border=(["\'])?.*?(?(2)\2|\s)([^>]+>)

Created with RegexBuddy