#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "^"
Local $sString = "<?php" & @CRLF & _
"" & @CRLF & _
"namespace App\Jobs\Library\Domain;" & @CRLF & _
"" & @CRLF & _
"use Illuminate\Bus\Queueable;" & @CRLF & _
"use App\Services\YorLinkService;" & @CRLF & _
"use Illuminate\Queue\SerializesModels;" & @CRLF & _
"use Illuminate\Queue\InteractsWithQueue;" & @CRLF & _
"use Illuminate\Contracts\Queue\ShouldQueue;" & @CRLF & _
"use Illuminate\Foundation\Bus\Dispatchable;" & @CRLF & _
"" & @CRLF & _
"class AddDomainLink implements ShouldQueue" & @CRLF & _
"{" & @CRLF & _
" use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;" & @CRLF & _
"" & @CRLF & _
" protected string $link_id;" & @CRLF & _
"" & @CRLF & _
" protected string $domain_id;" & @CRLF & _
"" & @CRLF & _
" protected string $path;" & @CRLF & _
"" & @CRLF & _
" protected YorLinkService $yorLinkService;" & @CRLF & _
"" & @CRLF & _
" /**" & @CRLF & _
" * Create a new job instance." & @CRLF & _
" *" & @CRLF & _
" * @param $link_id" & @CRLF & _
" * @param $domain_id" & @CRLF & _
" * @param $path" & @CRLF & _
" */" & @CRLF & _
" public function __construct(string $link_id, string $domain_id, string $path)" & @CRLF & _
" {" & @CRLF & _
" $this->yorLinkService = new YorLinkService;" & @CRLF & _
" $this->link_id = $link_id;" & @CRLF & _
" $this->domain_id = $domain_id;" & @CRLF & _
" $this->path = $path;" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" /**" & @CRLF & _
" * @param $yorLinkService" & @CRLF & _
" */" & @CRLF & _
" public function setYorLinkServiceMock($yorLinkService)" & @CRLF & _
" {" & @CRLF & _
" $this->yorLinkService = $yorLinkService;" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" /**" & @CRLF & _
" * Execute the job." & @CRLF & _
" *" & @CRLF & _
" * @return void" & @CRLF & _
" */" & @CRLF & _
" public function handle()" & @CRLF & _
" {" & @CRLF & _
" $this->yorLinkService->createLink([" & @CRLF & _
" 'link_id' => $this->link_id," & @CRLF & _
" 'domain_id' => $this->domain_id," & @CRLF & _
" 'path' => $this->path" & @CRLF & _
" ]);" & @CRLF & _
" }" & @CRLF & _
"}" & @CRLF & _
""
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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