<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cached_replace_compile(pattern, repl, flags, pattern_type):
 """Cached replace compile."""


    return _bregex_parse._ReplaceParser().parse(pattern, repl, bool(flags & FORMAT))