def regex_last_key(regex):
def k(obj):<EOL><INDENT>if regex.search(obj):<EOL><INDENT>return (<NUM_LIT:1>, obj)<EOL><DEDENT>return (<NUM_LIT:0>, obj)<EOL><DEDENT>return k<EOL>
Sort key function factory that puts items that match a
    regular expression last.

    >>> from nose.config import Config
    >>> from nose.pyversion import sort_list
    >>> c = Config()
    >>> regex = c.testMatch
    >>> entries = ['.', '..', 'a_test', 'src', 'lib', 'test', 'foo.py']
    >>> sort_list(entries, regex_last_key(regex))
    >>> entries
    ['.', '..', 'foo.py', 'lib', 'src', 'a_test', 'test']