#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?:(:\n\s))(?:\s|\n|(?:.(?!modern))*)*"
Local $sString = "js/modern/redux/actions/open-file-in-new-window.js:" & @CRLF & _
" 8 import { openWindow, maybeSetVariantRedirectDomainQueryParam } from '@slack/infra/multi-window';" & @CRLF & _
" 9: import getPrimaryView from '@slack/redux/stores/workspace-store/get-primary-view';" & @CRLF & _
" 10 import { isGovSlack } from '@slack/utility/is-gov-slack';" & @CRLF & _
"" & @CRLF & _
" 26 const teamId = getTeamId(team);" & @CRLF & _
" 27: const conversationId = getPrimaryView(state);" & @CRLF & _
" 28 let fileUrl = teamId" & @CRLF & _
"" & @CRLF & _
"js/modern/redux/actions/open-shortcuts-menu.js:" & @CRLF & _
" 10 import looksLikeChannelId from '@slack/utility/looks-like-channel-id';" & @CRLF & _
" 11: import getPrimaryView from '@slack/redux/stores/workspace-store/get-primary-view';" & @CRLF & _
" 12 import jumpToMessage from '@slack/redux/actions/jump-to-message';" & @CRLF & _
"" & @CRLF & _
" 25 const state = getState();" & @CRLF & _
" 26: const primaryViewId = getPrimaryView(state);" & @CRLF & _
" 27 "
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