#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^[ \t]*data_augmentation_options[\s\S]+(?=^[ \t]*data_augmentation_options)"
Local $sString = " batch_size: 4" & @CRLF & _
" num_steps: 30" & @CRLF & _
" data_augmentation_options {" & @CRLF & _
" random_horizontal_flip {" & @CRLF & _
" keypoint_flip_permutation: 0" & @CRLF & _
" keypoint_flip_permutation: 2" & @CRLF & _
" keypoint_flip_permutation: 1" & @CRLF & _
" keypoint_flip_permutation: 4" & @CRLF & _
" keypoint_flip_permutation: 3" & @CRLF & _
" keypoint_flip_permutation: 6" & @CRLF & _
" keypoint_flip_permutation: 5" & @CRLF & _
" keypoint_flip_permutation: 8" & @CRLF & _
" keypoint_flip_permutation: 7" & @CRLF & _
" keypoint_flip_permutation: 10" & @CRLF & _
" keypoint_flip_permutation: 9" & @CRLF & _
" keypoint_flip_permutation: 12" & @CRLF & _
" keypoint_flip_permutation: 11" & @CRLF & _
" keypoint_flip_permutation: 14" & @CRLF & _
" keypoint_flip_permutation: 13" & @CRLF & _
" keypoint_flip_permutation: 16" & @CRLF & _
" keypoint_flip_permutation: 15" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" data_augmentation_options {" & @CRLF & _
" random_crop_image {" & @CRLF & _
" min_aspect_ratio: 0.5" & @CRLF & _
" max_aspect_ratio: 1.7" & @CRLF & _
" random_coef: 0.25" & @CRLF & _
" }" & @CRLF & _
" }"
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