I am trying to create a regex to match any of a list of hex commands e.g.
\x0a\x0b
or \x76\x69
or \x5e\x6a\x56\x02
...
My initial approach was to use:
re.compile(b"|".join([hex_list])
However, as I do not know what the hex strings contain until the program is executed this can cause a problem when the hex code for special regex characters such as (
(ascii code\x28
) are passed in.
What I am looking for is something akin to the raw string which will allow me to strictly match the characters themselves.