my current code is ^0x[a-z\d]+|^0o[\d]+ and it fails.
Capture numbers in octal or hexadecimal representation in Python. Octal numbers start with a prefix "0o" (number zero followed by lowercase letter o), and are followed by one or more numbers in the range of 0 to 7. E.g. 0o112, 0o237, 0o07.
Hexadecimal numbers start with a prefix "0x", and are followed by one or more numbers in the range of 0 to 9 or lowercase letters in the range of a to f. E.g. 0xf3, 0x1d, 0x072.