^start of string
Comment: Piece Placement Section
Group PiecePlacement(?<PiecePlacement>((?<RankItem>[pnbrqkPNBRQK1-8]{1,8})\/?){8}) Group 2((?<RankItem>[pnbrqkPNBRQK1-8]{1,8})\/?){8} {8}repeats the group contents below exactly 8 times:
Group RankItem(?<RankItem>[pnbrqkPNBRQK1-8]{1,8}) Character Class[pnbrqkPNBRQK1-8]{1,8} {1,8}matches between 1 and 8 characters from the set below:
pthe literal p (11210 / 1608 / 7016) (case sensitive)
nthe literal n (11010 / 1568 / 6E16) (case sensitive)
bthe literal b (9810 / 1428 / 6216) (case sensitive)
rthe literal r (11410 / 1628 / 7216) (case sensitive)
qthe literal q (11310 / 1618 / 7116) (case sensitive)
kthe literal k (10710 / 1538 / 6B16) (case sensitive)
Pthe literal P (8010 / 1208 / 5016) (case sensitive)
Nthe literal N (7810 / 1168 / 4E16) (case sensitive)
Bthe literal B (6610 / 1028 / 4216) (case sensitive)
Rthe literal R (8210 / 1228 / 5216) (case sensitive)
Qthe literal Q (8110 / 1218 / 5116) (case sensitive)
Kthe literal K (7510 / 1138 / 4B16) (case sensitive)
1-8one character from 1 (4910) to 8 (5610)
\/?optionally matches the literal / (4710 / 578 / 2F16)
Comment: Section Separator
\s+any whitespace character, repeated at least once
Comment: Side To Move Section
Group SideToMove(?<SideToMove>b|w) bthe literal b (9810 / 1428 / 6216) (case sensitive)
wthe literal w (11910 / 1678 / 7716) (case sensitive)
Comment: Section Separator
\s+any whitespace character, repeated at least once
Comment: Castling Ability
Group Castling(?<Castling>-|K?Q?k?q) -the literal - (4510 / 558 / 2D16)
K?optionally matches the literal K (7510 / 1138 / 4B16) (case sensitive)
Q?optionally matches the literal Q (8110 / 1218 / 5116) (case sensitive)
k?optionally matches the literal k (10710 / 1538 / 6B16) (case sensitive)
qthe literal q (11310 / 1618 / 7116) (case sensitive)
Comment: Section Separator
\s+any whitespace character, repeated at least once
Comment: En passant
Group EnPassant(?<EnPassant>-|[a-h][3-6]) -the literal - (4510 / 558 / 2D16)
2nd Alternative[a-h][3-6] a-hone character from a (9710) to h (10410) (case sensitive)
3-6one character from 3 (5110) to 6 (5410)
Comment: Section Separator
\s+any whitespace character, repeated at least once
Comment: Half Move Clock
Group HalfMoveClock(?<HalfMoveClock>\d+) \d+a digit, repeated at least once
Comment: Section Separator
\s+any whitespace character, repeated at least once
Comment: Full Move Number
Group FullMoveNumber(?<FullMoveNumber>\d+) \d+a digit, repeated at least once
\s*any whitespace character, repeated any number of times
$end of string, or before its final line terminator
x modifier: extended. Ignores unescaped whitespace and comments outside character classes