#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "^([\w.]+\.)\s+.+\sNS\s.+\1"
Local $sString = "piggyvoucher.com. 86400 IN SOA ns1.krystal.co.uk. admin.krystal.co.uk. (" & @CRLF & _
" 2014060600 ;Serial Number" & @CRLF & _
" 86400 ;refresh" & @CRLF & _
" 7200 ;retry" & @CRLF & _
" 3600000 ;expire" & @CRLF & _
" 86400 ;minimum" & @CRLF & _
" )" & @CRLF & _
"" & @CRLF & _
"piggyvoucher.com. 86400 IN NS ns1.piggyvoucher.com." & @CRLF & _
"piggyvoucher.com. 86400 IN NS ns2.krystal.co.uk." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"piggyvoucher.com. 14400 IN A 77.72.0.110" & @CRLF & _
"" & @CRLF & _
"localhost 14400 IN A 127.0.0.1" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"mail 14400 IN CNAME piggyvoucher.com." & @CRLF & _
"www 14400 IN CNAME piggyvoucher.com." & @CRLF & _
"ftp 14400 IN A 77.72.0.110" & @CRLF & _
"cpanel 14400 IN A 77.72.0.110"
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