1

PCI addresses adhere to the BDF notation

What would be a good way to determine if a string contains a valid PCI address? Any programming language would do.

omer
  • 1,242
  • 4
  • 18
  • 45

1 Answers1

0

So I came up with the following regex (javascript) to cover the basic BDF:

^([a-fA-F0-9]{2}|[a-fA-F0-9]{4}):[a-fA-F0-9]{2}\.[a-fA-F0-9]{1,2}$

extending it to cover the extended versions of BDF should not be that hard.

omer
  • 1,242
  • 4
  • 18
  • 45