#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?i)\b(Devices|Community String)\b\s*-\s*([\w,\/]+)"
Local $sString = "1. What is being changed?" & @CRLF & _
"Add in Solarwinds monitoring the router and switch of the new Store:" & @CRLF & _
"" & @CRLF & _
"Devices - MCHLS5178,sw517801,sr517800,sr517801,sr517802,MCHLS5184,sw518401,sr518400,sr518401,sr518402" & @CRLF & _
"Community String - N/A" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"2. Where it is being changed?" & @CRLF & _
"Solarwinds monitoring (10.3.4.7)" & @CRLF & _
"" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"3. Why it is being changed?" & @CRLF & _
"To monitor the router and switch of the store 5178,5184" & @CRLF & _
"" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"4. What is the Business Impact of the Change?" & @CRLF & _
"No business impact during implementation." & @CRLF & _
"" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"5. Who will be doing the change? " & @CRLF & _
"Network team" & @CRLF & _
"" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"6. When is the change happening?" & @CRLF & _
"2020-01-26 01:00:00" & @CRLF & _
"" & @CRLF & _
" " & @CRLF & _
"" & @CRLF & _
"7. Who will be testing the change after implementation?" & @CRLF & _
"Network team"
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