code: def _get_cache_size(replace=False):
      
  
      if not replace:
          size = _cached_search_compile.cache_info().currsize
      else:
          size = _cached_replace_compile.cache_info().currsize
      return size
docs: Get size of cache.