-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
match pci addresses with hex a-f in them #866
Conversation
@@ -163,7 +163,7 @@ end | |||
-- | |||
-- example: qualified("01:00.0") -> "0000:01:00.0" | |||
function qualified (address) | |||
return address:gsub("^%d%d:%d%d[.]%d+$", "0000:%1") | |||
return address:gsub("^[0-9a-f][0-9a-f]:[0-9a-f][0-9a-f][.][0-9a-f]+$", "0000:%1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! In Lua there's wildcard '%x' which matches hexadecimal digits. See http://www.lua.org/pil/20.2.html.
@petebristow @dpino Using |
No %x does not match upper case letters, or at least it didn't in my testing. |
@petebristow Just tested it on Lua and LuaJIT and |
This does what is says on the tin, pci addresses are hex and can contain a-f as well as 0-9