<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compile_search(pattern, flags=0, **kwargs):
 """Compile with extended search references."""


    return _regex.compile(_apply_search_backrefs(pattern, flags), flags, **kwargs)