#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)@import\s*(url)?\s*\(?([^;]+?)\)?;"
Local $sString = "@import url(comments.css);" & @CRLF & _
"body{" & @CRLF & _
" margin: 0px;" & @CRLF & _
" padding: 0px;" & @CRLF & _
" background: #FFFFFF;" & @CRLF & _
" font: normal small "Trebuchet MS", Arial, Helvetica, sans-serif;" & @CRLF & _
" color: #777777;" & @CRLF & _
"}" & @CRLF & _
"@import "/style/main.css" screen; /* Стиль Ð´Ð»Ñ Ð²Ñ‹Ð²Ð¾Ð´Ð° результата на монитор */" & @CRLF & _
"@import "/style/palm.css" handheld, print; /* Стиль Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸ *" & @CRLF & _
"" & @CRLF & _
"@import url("style-1024.css") screen and (min-width: 1000px) and (max-width: 1279px);" & @CRLF & _
"@import url("style-1280.css") screen and (min-width: 1280px) and (max-width: 1300px);" & @CRLF & _
"@import url("style-1366.css") screen and (min-width: 1301px) and (max-width: 1900px);" & @CRLF & _
"@import url("style-1366.css") screen and (min-width: 1901px);"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; 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