#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)\[img width=.*?\].*?\[\/img\]"
Local $sString = "<img src="test.jpg" width="" height="" />" & @CRLF & _
"" & @CRLF & _
"<iframe src="somepage.html width="500" height="100"></iframe>" & @CRLF & _
"" & @CRLF & _
"<img src="test2.jpg" width="" height="" />" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"[url=http://forumexpertwatch.s3.byteark.com/ark_20210602-203927_9e92ba4bc8c48d338943b3827c08fad9_07E145BB-FE0E-4265-806B-A6C6F3E0B4A5.jpeg][img width=499]http://forumexpertwatch.s3.byteark.com/ark_20210602-203927_9e92ba4bc8c48d338943b3827c08fad9_07E145BB-FE0E-4265-806B-A6C6F3E0B4A5.jpeg[/img][/url][br /]"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm