#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^((?!V2).)*- Master\s*$"
Local $sString = "AppMessages V2 - Dev" & @CRLF & _
"AppMessages V2 - Master" & @CRLF & _
"AWS - Octopus Release" & @CRLF & _
"Bellhop Model V2 - Dev" & @CRLF & _
"Bellhop Model V2 - Master" & @CRLF & _
"BellHop Services V2 - Dev" & @CRLF & _
"BellHop Services V2 - Master" & @CRLF & _
"BellHop V2 - Dev" & @CRLF & _
"BellHop V2 - Master" & @CRLF & _
"BSG Log4j Extras V2 - Dev" & @CRLF & _
"BSG Log4j Extras V2 - Master" & @CRLF & _
"BSG-BOM - Dev" & @CRLF & _
"BSG-BOM - Master" & @CRLF & _
"BSG-BOM V2 - Dev" & @CRLF & _
"BSG-BOM V2 - Master" & @CRLF & _
"Core Model V2 - Dev" & @CRLF & _
"Core Model V2 - Master" & @CRLF & _
"Core Services V2 - Dev" & @CRLF & _
"Core Services V2 - Master" & @CRLF & _
"DealerLocator - Dev" & @CRLF & _
"EMS Services V2 - Dev" & @CRLF & _
"EMS Services V2 - Master" & @CRLF & _
"Entitlements REST API V2 - Dev" & @CRLF & _
"Entitlements REST API V2 - Master" & @CRLF & _
"Entitlements Services V2 - Dev" & @CRLF & _
"Entitlements Services V2 - Master" & @CRLF & _
"Entitlements SOAP API V2 - Dev" & @CRLF & _
"Entitlements SOAP API V2 - Master" & @CRLF & _
"FlexNet Services - Dev" & @CRLF & _
"FlexNet Services - Master" & @CRLF & _
"GetNodeInfo BusSys-Build-Slave-01" & @CRLF & _
"GetNodeInfo BusSys_Corp_Build_Slave" & @CRLF & _
"GetNodeInfo Master" & @CRLF & _
"Laipac Services V2 - Dev" & @CRLF & _
"Laipac Services V2 - Master" & @CRLF & _
"LDK Services V2 - Dev" & @CRLF & _
"LDK Services V2 - Master" & @CRLF & _
"LicenseAdmin - Dev" & @CRLF & _
"LicenseAdmin - Master" & @CRLF & _
"List All Jobs" & @CRLF & _
"Lite Services V2 - Dev" & @CRLF & _
"Lite Services V2 - Master" & @CRLF & _
"LiteFlexNetIntegration V2 - Dev" & @CRLF & _
"LiteFlexNetIntegration V2 - Master" & @CRLF & _
"LiteIntegration - Dev" & @CRLF & _
"LiteIntegration - Master" & @CRLF & _
"Messaging Services V2 - Dev" & @CRLF & _
"Messaging Services V2 - Master" & @CRLF & _
"MTPConsumer - Dev" & @CRLF & _
"MTPConsumer - Master" & @CRLF & _
"OptionKeys - Dev" & @CRLF & _
"OptionKeys - Master" & @CRLF & _
"OptionKeysAPI - Dev" & @CRLF & _
"OptionKeysAPI - Master" & @CRLF & _
"Panther REST API V2 - Dev" & @CRLF & _
"Pools API V2 - Dev" & @CRLF & _
"Pools API V2 - Master" & @CRLF & _
"Pools Model V2 - Dev" & @CRLF & _
"Pools Model V2 - Master" & @CRLF & _
"Pools Services V2 - Dev" & @CRLF & _
"Pools Services V2 - Master" & @CRLF & _
"Preconfigured API V2 - Dev" & @CRLF & _
"Preconfigured API V2 - Master" & @CRLF & _
"SCL Client V2 - Dev" & @CRLF & _
"SCL Client V2 - Master" & @CRLF & _
"SentinelCloud Services V2 - Dev" & @CRLF & _
"SentinelCloud Services V2 - Master" & @CRLF & _
"SubscriptionManager V2 - Dev" & @CRLF & _
"SubscriptionManager V2 - Master" & @CRLF & _
"TermsOfService - Master" & @CRLF & _
"Test Support V2 - Dev" & @CRLF & _
"Test Support V2 - Master" & @CRLF & _
"Tid Services V2 - Dev" & @CRLF & _
"Tid Services V2 - Master" & @CRLF & _
"Upload templates to S3 - branch2Dev" & @CRLF & _
"Upload templates to S3 - Dev" & @CRLF & _
"Upload templates to S3 - Master" & @CRLF & _
"Upload templates to S3 - Test" & @CRLF & _
"VirtualWarehouse - Dev" & @CRLF & _
"VirtualWarehouse - Master" & @CRLF & _
"VirtualWarehouse Services V2 - Dev" & @CRLF & _
"VirtualWarehouse Services V2 - Master" & @CRLF & _
"VW Lite API - Dev" & @CRLF & _
"VW Lite API - Master" & @CRLF & _
"VW Remedy Events - Dev" & @CRLF & _
"VW Remedy Events - Master" & @CRLF & _
"VW Remedy Events Consumer - Dev" & @CRLF & _
"VW Remedy Events Consumer - Master" & @CRLF & _
"VW Remedy Events Lib - Dev" & @CRLF & _
"VW Remedy Events Lib - Master" & @CRLF & _
"VW Scheduled Tasks V2 - Dev" & @CRLF & _
"VW Scheduled Tasks V2 - Master" & @CRLF & _
"VW Sentinel V2 - Dev" & @CRLF & _
"VW Sentinel V2 - Master" & @CRLF & _
"VW Subscriptions V2 - Dev" & @CRLF & _
"VW Subscriptions V2 - Master" & @CRLF & _
"VW5 - Dev" & @CRLF & _
"VW5 - Master" & @CRLF & _
"WooCommerce API V2 - Dev" & @CRLF & _
"WooCommerce API V2 - Master" & @CRLF & _
"WooCommerce Model V2 - Dev" & @CRLF & _
"WooCommerce Model V2 - Master" & @CRLF & _
"WooCommerce Services V2 - Dev" & @CRLF & _
"WooCommerce Services V2 - Master"
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