#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mx)^>" & @CRLF & _
"(?P<header>" & @CRLF & _
"[^\n()]*" & @CRLF & _
" (?:\((?P<name>[^\n()]+)\))?" & @CRLF & _
"[^()\n]*" & @CRLF & _
")" & @CRLF & _
"[\n\r]" & @CRLF & _
"(?P<content>[\s\S]+?)(?=^>|\Z)"
Local $sString = ">XM_024446048.1 PREDICTED: Homo sapiens mannosidase alpha class 2A member 1 (MAN2A1), transcript variant X2, mRNA" & @CRLF & _
"CAGCCCCC" & @CRLF & _
"TGAGCGAC" & @CRLF & _
"TCCCTAATGTG" & @CRLF & _
"ACAGTAAAGAA" & @CRLF & _
">NM_001308028.1 Homo sapiens FER tyrosine kinase (FER), transcript variant 2, mRNA" & @CRLF & _
"CAGCCC" & @CRLF & _
"CCGTGACGC" & @CRLF & _
"GGGGTGGTGACT" & @CRLF & _
"GGCTC" & @CRLF & _
"GGTGGT" & @CRLF & _
"GTGAC" & @CRLF & _
">NM_0013082323028.1 H STZ mRSN1A" & @CRLF & _
"CAGCCC" & @CRLF & _
"CCGTGACGC" & @CRLF & _
"GGG" & @CRLF & _
"GTGGTGA" & @CRLF & _
"CTGGCTCCGGAGT" & @CRLF & _
"CTGAGGGGTTCGG"
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