#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)i18\s*\(\s*['"](.+)['"]\,.*\)"
Local $sString = "i18('Grant (\'%s\') access to ALL users to feature: ', permission.toUpperCase());" & @CRLF & _
"" & @CRLF & _
"alert(i18("These users already :") exist and were:") ', not added:") + :") ) xxx + "\n\n" + msg ); " & @CRLF & _
"" & @CRLF & _
" var msg;" & @CRLF & _
" if (permission == 'none') {" & @CRLF & _
" msg = i18('This action will remove the rights for \'%s\' from feature: ', userName);" & @CRLF & _
" } else if (permission == 'complete') { " & @CRLF & _
" msg = i18('Grant ALL rights for \'%s\' to feature: ', userName);" & @CRLF & _
" } else { " & @CRLF & _
" msg = i18('Grant (\'%s\') access for \'%s\' to feature: ', [permission.toUpperCase(), userName]);" & @CRLF & _
" }"
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