Given that PCI address: and driver: lines go one by one, with Raku/Sparrow this is just few lines of code:
begin:
~regexp: "PCI Address:" \s+ (\S+)
~regexp: "driver:" \s+ [nvidia || amd || intel]
end:
code: <<RAKU
!raku
for streams().values -> $pci {
say $pci<>.head()<captures><>.head
}
RAKU