What is the type of the compiled regular expression in python?
In particular, I want to evaluate
isinstance(re.compile(\'\'), ???)
FYI an example of such code is in BeautifulSoup: http://www.crummy.com/software/BeautifulSoup and uses the 'hasattr' technique. In the spirit of the "alternative approach", you might also encapsulate your string search in a regexp by doing this: regexp = re.compile(re.escape(your_string)) therefore having a list of only regular expressions.