def reset_selective(self, regex=None):
if regex is not None:<EOL><INDENT>try:<EOL><INDENT>m = re.compile(regex)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>for ns in self.all_ns_refs:<EOL><INDENT>for var in ns:<EOL><INDENT>if m.search(var):<EOL><INDENT>del ns[var]<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Clear selective variables from internal namespaces based on a
        specified regular expression.

        Parameters
        ----------
        regex : string or compiled pattern, optional
            A regular expression pattern that will be used in searching
            variable names in the users namespaces.