def is_re_compilable(obj):
try:<EOL><INDENT>re.compile(obj)<EOL><DEDENT>except TypeError:<EOL><INDENT>return False<EOL><DEDENT>else:<EOL><INDENT>return True<EOL><DEDENT>
Check if the object can be compiled into a regex pattern instance.

Parameters
----------
obj : The object to check

Returns
-------
is_regex_compilable : bool
    Whether `obj` can be compiled as a regex pattern.

Examples
--------
>>> is_re_compilable(".*")
True
>>> is_re_compilable(1)
False