def Search(pattern, s):
if pattern not in _regexp_compile_cache:<EOL><INDENT>_regexp_compile_cache[pattern] = sre_compile.compile(pattern)<EOL><DEDENT>return _regexp_compile_cache[pattern].search(s)<EOL>
Searches the string for the pattern, caching the compiled regexp.