Skip to content

Commit afd93d5

Browse files
committed
Updated OUI parsing regex string
1 parent b5a3fe7 commit afd93d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flat_postprocess/oui_postprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import subprocess
55
import sys
66

7-
HEX_RE = r"^(?P<hex>[0-9A-Fa-f]{6})\s*\(base 16\)\s+(?P<company>.+?)\s*$"
7+
HEX_RE = r"^MA-L,(?P<hex>[0-9A-Fa-f]{6}),\"(?P<company>[^\"]+)\",.*$"
88

99
OUI_MAPPINGS = {}
1010
URL = "https://standards-oui.ieee.org/oui/oui.txt"
@@ -36,6 +36,7 @@ def download_csv_text(url: str = URL) -> str:
3636
with open(output_path, "r", encoding="utf-8", newline="") as oui_file:
3737
for line in oui_file:
3838
if re.search(HEX_RE, line):
39+
print()
3940
group_regex_values = re.search(HEX_RE, line).groupdict()
4041
if group_regex_values.get("hex") and group_regex_values.get("company"):
4142
OUI_MAPPINGS.update({group_regex_values.get("hex").lower(): group_regex_values.get("company")})

0 commit comments

Comments
 (0)