#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?:^| )(?:(?:https:\/\/)?(?:www\.)?github\.com\/(?<org>[^ \/\n]+)\/(?<repo>[^ \/\n]+)\/issues\/(?<number>[0-9]+)(?:\/)?)(?: |$)"
Local $sString = "ASDFASDF" & @CRLF & _
"asdfasdfASdf" & @CRLF & _
"asdf" & @CRLF & _
"asdf" & @CRLF & _
"" & @CRLF & _
"asdfasdf https://github.com/zeebe-io/backport-action/issues asdf github.com/zeebe-io/backport-action/issues/30 asdf" & @CRLF & _
"asdfasdf www.github.com/zeebe-io/" & @CRLF & _
"backport-action/issues/30 asdf" & @CRLF & _
"" & @CRLF & _
"asdfasdf www.github.com/zeebe-io/backport-action/issues/30asdf" & @CRLF & _
"asdfasdfwww.github.com/zeebe-io/backport-action/issues/30 asdf" & @CRLF & _
"asdfasdfwww.github.com/zeebe-io/backport-action/issues/30asdf" & @CRLF & _
"" & @CRLF & _
"asdfsdf https://www.github.com/zeebe-io/backport-action/issues/30 asdfasdfasdf" & @CRLF & _
"sadhkasjh https://github.com/zeebe-io/backport-action/issues/30/ asdjfkghasdf" & @CRLF & _
"sadfasdf asdf asdfsdf #123 asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf zeebe-io/zeebe#123 asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf #sdafsdf asdfasf#123 sadf #442" & @CRLF & _
"" & @CRLF & _
"#123 asdasdasd" & @CRLF & _
"sadfasdf asdf asdfsdf #123 asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf #123asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf#123 asdfasf#123 sad" & @CRLF & _
"adasdasdasd #123" & @CRLF & _
"" & @CRLF & _
"zeebe-io/zeebe#123 asdfas" & @CRLF & _
"sadfasdf asdf asdfsdf zeebe-io/" & @CRLF & _
"zeebe#123 asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf zeebe-io/zeebe#123 asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf zeebe-io/zeebe#123asdfasf#123 sad" & @CRLF & _
"sadfasdf asdf asdfsdf/zeebe-io/zeebe#123 asdfasf#123 sad" & @CRLF & _
"asdasfasf zeebe-io/zeebe#123" & @CRLF & _
"" & @CRLF & _
"#123" & @CRLF & _
"closes#234asdfasdf" & @CRLF & _
"resolves #123123123123" & @CRLF & _
"" & @CRLF & _
"#234" & @CRLF & _
"" & @CRLF & _
"Bye bye"
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