Hi Experts,
I am facing issues in getting the correct regexp for this use-case. Sorry for the 2nd question of the day :-(
pci@0000:19:00.0
pci@0000:19:00.1
pci@0000:5e:00.2
pci@0000:5e:00.3
pci@0000:d8:00.0
pci@0000:d8:00.1
I need to fetch "0000:19:00.0" through "0000:d8:00.1" in a string.. I used the below regexp and was successful for "0000:19:00.0", but the same doesnt work for 5e or d8 and vice versa
r := regexp.MustCompile(`(\d*([a-f]*):\d*([a-f]*):\d+.\d+)`)
yields - [{ 0000:19:00.0} { 0000:19:00.1} { } { } { } { }]
(or)
r := regexp.MustCompile(`(\d*([a-f]*):\d+([a-f]*)|([a-f]+)\d+:\d+.\d+)`)
yields - [ 0000:19} { 0000:19} { d8:00.0} { d8:00.1} { d8:00.2} { d8:00.3}]
Please share your thoughts.
Sharan