#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?x)^" & @CRLF & _
"(?# Piece Placement Section)(?<PiecePlacement>((?<RankItem>[pnbrqkPNBRQK1-8]{1,8})\/?){8})" & @CRLF & _
"(?# Section Separator)\s+" & @CRLF & _
"(?# Side To Move Section) (?<SideToMove>b|w)" & @CRLF & _
"(?# Section Separator)\s+" & @CRLF & _
"(?# Castling Ability) (?<Castling>-|K?Q?k?q)" & @CRLF & _
"(?# Section Separator)\s+" & @CRLF & _
"(?# En passant) (?<EnPassant>-|[a-h][3-6])" & @CRLF & _
"(?# Section Separator)\s+" & @CRLF & _
"(?# Half Move Clock) (?<HalfMoveClock>\d+)" & @CRLF & _
"(?# Section Separator)\s+" & @CRLF & _
"(?# Full Move Number) (?<FullMoveNumber>\d+)" & @CRLF & _
"\s*" & @CRLF & _
"$"
Local $sString = "rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2"
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