#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<type>[A-Za-z]{1})(?<subtype>[A-Za-z<]{1})(?<expcountry>[A-Za-z]{3})(?<docnumber>[0-9A-Za-z<]{9})(?<docnumbercheck>[0-9]{1})(?<complement>[0-9a-zA-Z<]{15})\n(?<birthdate>[0-9]{6})(?<birthcheck>[0-9]{1})(?<sex>[mfMF]{1})(?<expiredate>[0-9]{6})(?<expirecheck>[0-9]{1})(?<nacionality>[A-Za-z]{3})(?<optional>[a-zA-Z0-9<]{11})(?<linecheck>[0-9]{1})\n(?<lname>[A-Z]+)(?<lname2><[A-Z]+){0,}<<(?<spacing>[<]{0,})(?<fname>[A-Z]+)(?<mname1><[A-Z]+){0,}(?<namecomplement>[a-zA-Z<]+){0,}"
Local $sString = "IDCHES0002068<8<<<<<<<<<<<<<<<" & @CRLF & _
"8102287F1301014CHE<<<<<<<<<<<4" & @CRLF & _
"VADIS<<QUO<<<<<<<<<<<<<<<<<<<<" & @CRLF & _
"" & @CRLF & _
"I<UTOD231458907<<<<<<<<<<<<<<<" & @CRLF & _
"7408122F1204159UTO<<<<<<<<<<<6" & @CRLF & _
"ERIKSSON<<ANNA<MARIA<<<<<<<<<<" & @CRLF & _
"" & @CRLF & _
"I<NLDXI020DF236123456783<<<<<<" & @CRLF & _
"7208148F1108268NLD<<<<<<<<<<<9" & @CRLF & _
"VAN<DER<STEEN<<MARIANNE<LOUISE"
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