#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^[ \t]*(?>etaLearnW_enabled)[ \t]?=[ \t]?(?<etaLearnW_enabled>[01])[ \t]*[ \t]*;?"
Local $sString = "%% LEARNING RATES and other HYPER PARAMETERS" & @CRLF & _
" lambdaInfomaxTerm = 1; %coeff before logdetT'T, 0 or 1" & @CRLF & _
" " & @CRLF & _
" etaLearnW_enabled = 1;" & @CRLF & _
"etaLearnW_enabled = 1;" & @CRLF & _
"% etaLearnW_enabled = 1;" & @CRLF & _
" %etaLearnW_enabled = 1;" & @CRLF & _
" etaLearnW = 1E-4;" & @CRLF & _
"" & @CRLF & _
" %lambdaRidgeW = 3e-3; %going down, crashes on epoch 3888" & @CRLF & _
" lambdaRidgeW = 3e-2;" & @CRLF & _
" " & @CRLF & _
" etaLearnK_enabled = 1;" & @CRLF & _
" etaLearnK = 4E-5; " & @CRLF & _
" " & @CRLF & _
" %PostSlim:" & @CRLF & _
" %lambdaRidgeK = 3e-5; %too weak (going down fast)" & @CRLF & _
" %lambdaRidgeK = 3e-4; %too weak (fails at #14628)" & @CRLF & _
"" & @CRLF & _
" lambdaRidgeK = 1e-3;"
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