#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\s*(#|$).*$"
Local $sString = "# Configuration section config." & @CRLF & _
"# How LVM configuration settings are handled." & @CRLF & _
"config {" & @CRLF & _
"" & @CRLF & _
" # Configuration option config/checks." & @CRLF & _
" # If enabled, any LVM configuration mismatch is reported." & @CRLF & _
" # This implies checking that the configuration key is understood by" & @CRLF & _
" # LVM and that the value of the key is the proper type. If disabled," & @CRLF & _
" # any configuration mismatch is ignored and the default value is used" & @CRLF & _
" # without any warning (a message about the configuration key not being" & @CRLF & _
" # found is issued in verbose mode only)." & @CRLF & _
" checks = 1" & @CRLF & _
"" & @CRLF & _
" # Configuration option config/abort_on_errors." & @CRLF & _
" # Abort the LVM process if a configuration mismatch is found." & @CRLF & _
" abort_on_errors = 0" & @CRLF & _
"" & @CRLF & _
" # Configuration option config/profile_dir." & @CRLF & _
" # Directory where LVM looks for configuration profiles." & @CRLF & _
" profile_dir = "/etc/lvm/profile"" & @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