parameters: (pattern, replacement, s)
return_statement: return _regexp_compile_cache[pattern].sub(replacement, s)
docstring: Substitutes occurrences of a pattern, caching the compiled regexp.
docstring_summary: Substitutes occurrences of a pattern, caching the compiled regexp.
docstring_tokens: Substitutes occurrences of a pattern caching the compiled regexp .
function: def sub(pattern, replacement, s):
      """Substitutes occurrences of a pattern, caching the compiled regexp."""
      if not pattern in _regexp_compile_cache:
          _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
      return _regexp_compile_cache[pattern].sub(replacement, s)
function_tokens: def sub ( pattern , replacement , s ) : if not pattern in _regexp_compile_cache : _regexp_compile_cache [ pattern ] = sre_compile . compile ( pattern ) return _regexp_compile_cache [ pattern ] . sub ( replacement , s )