#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "Number\:\s(?<Number>\d+)[\r\n]Category\:\s(?<Category>.*).*[\r\n].*[\r\n].*[\r\n]What\sis\sthe\sspecific\srole\sor\sfunction\sof\sthis\sserver\?\:\s(?<Function>.*).*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n]Server\sHostname\:\s(?<Hostname>.*).*[\r\n]Server\sAllegiance\:\s(?<Domain>.*).*[\r\n].*[\r\n]Physical\sLocation\:\s(?<Location>.*).*[\r\n].*[\r\n].*[\r\n].*[\r\n].*[\r\n]Local\sAdministrators\:\s+([\w\s]+)[\r\n].*[\r\n].*[\r\n]Task\sDescription\:\s(?<Task>.*)"
Local $sString = "Task # 12347859 has been opened and assigned to XXXXXXX - . " & @CRLF & _
"Task # 12347859" & @CRLF & _
"Client Details" & @CRLF & _
"Jackie Newman" & @CRLF & _
"servicedesk@thenet.com" & @CRLF & _
"" & @CRLF & _
"Assignment Details" & @CRLF & _
"User course@email.com" & @CRLF & _
"" & @CRLF & _
"Status and Priority Details" & @CRLF & _
"Urgency: 4-LOW" & @CRLF & _
"Impact: 4-MINOR" & @CRLF & _
"Status: Assigned" & @CRLF & _
"Task Details" & @CRLF & _
"Number: 12347859" & @CRLF & _
"Category: Add/Upgrade Server Software " & @CRLF & _
"Application: Production Web Server" & @CRLF & _
"Linked Record: CR123458756 - 2-Implementation" & @CRLF & _
"What is the specific role or function of this server?: XXXXXXXXXXXX" & @CRLF & _
"What is the primary application for this server deployment?: XXXXXXXXXXXXX" & @CRLF & _
"Provide a detailed description that explains the function or role of the server.: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" & @CRLF & _
"It will also be used as a proxy Card Recon scan server to scan application databases" & @CRLF & _
"Is this replacing an existing server?: Si" & @CRLF & _
"Please explain when will the old server be decommissioned?: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" & @CRLF & _
"Is this a physical or virtual server?: XXXXXXXXX" & @CRLF & _
"What is the required Operating System?: XXXXXXXXX" & @CRLF & _
"Patching Schedule: XXXXXXXXX" & @CRLF & _
"Environment - Is the server Production, Development or Disaster Recovery?: XXXXXXXXX" & @CRLF & _
"Server Hostname: XXXXXXXXX" & @CRLF & _
"Server Allegiance: XXXXXXXXX" & @CRLF & _
"Will SQL Server be required on this server?: XXX" & @CRLF & _
"Physical Location: XXXXXXXXX" & @CRLF & _
"Include in Enterprise Backups?: XX" & @CRLF & _
"Resource Requirements: RAM: XXXX" & @CRLF & _
"Resource Requirements: CPUs: XX" & @CRLF & _
"Resource Requirements: Disk [Quantity and Size(s)]: 40GB" & @CRLF & _
"Local Administrators: XXXXXXXXX" & @CRLF & _
"XXXXXXXXX" & @CRLF & _
"XXXXXXXXX" & @CRLF & _
"XXXXXXXXX" & @CRLF & _
"Directories to be excluded from Anti-Virus scanning: None" & @CRLF & _
"Additional Comments:" & @CRLF & _
"Task Description: XXXXXXXXX" & @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