PCRE 2+
(?x)
# fingerprint and grip records only have about 12 fields,
# so the match can't be too strict with the number of mandatory fields.
^
(?<FullRecordType>
(?<fieldRecortdType>[^:]*):
# 2
(?<fieldValidity>[^:]*):
# 3
(?<fieldKeyLength>[^:]*):
# 4
(?<fieldAlgo>[^:]*):
# 5 - field id
(?>[^:]*):
# 6
(?<fieldDate>[^:]*):
# 7
(?<fieldExpires>[^:]*):
# 8
(?<fieldSerialHash>[^:]*):
# 9 - owner trust
(?>[^:]*):
# 10 - IMPORTANT - USER ID !!!
(?<fieldUserID>[^:]*):
# 11 - sig class
(?>[^:]*):
# 12 - identity keys have no capability
(?<fieldCapabilities>[^:]*):
# 13 - issuer other info
# 14 - flag field
# 15 - serial number
(?>[^:]*):{3}
# 16 - hash algo
(?<fieldHashAlgo>[^:]*):
# 17 - curve name
(?<fieldCurveName>[^:]*):
# 18 - compliance
# 19 - udpated
# 20 - origin
# 21 - comment
(?>[:\d]){3,4}
# End MainRecordType.
)
# Short Record Type.
# (?<ShortRecordType>)*
GPG field reference
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS