def re_finder(regex, flags=0):
    """Creates a function finding regex in passed string."""
    regex, _getter = _prepare(regex, flags)
    getter = lambda m: _getter(m) if m else None
    return lambda s: getter(regex.search(s))
Creates a function finding regex in passed string.
funcy/strings.py