What is the type of the compiled regular expression in python?
In particular, I want to evaluate
isinstance(re.compile(\'\'), ???)
This is another not the answer to the question, but it solves the problem response. Unless your_string contains regular expression special characters,
if re.match(your_string,target_string):
has the same effect as
if your_string == target_string:
So drop back one step and use uncompiled regular expression patterns in your list of allowed. This is undoubtedly slower than using compiled regular expressions, but it will work with only the occasional unexpected outcome, and that only if you allow users to supply the allowed items