• Home
  • Raw
  • Download

Lines Matching refs:pattern

187 def match(pattern, string, flags=0):  argument
190 return _compile(pattern, flags).match(string)
192 def fullmatch(pattern, string, flags=0): argument
195 return _compile(pattern, flags).fullmatch(string)
197 def search(pattern, string, flags=0): argument
200 return _compile(pattern, flags).search(string)
202 def sub(pattern, repl, string, count=0, flags=0): argument
209 return _compile(pattern, flags).sub(repl, string, count)
211 def subn(pattern, repl, string, count=0, flags=0): argument
220 return _compile(pattern, flags).subn(repl, string, count)
222 def split(pattern, string, maxsplit=0, flags=0): argument
230 return _compile(pattern, flags).split(string, maxsplit)
232 def findall(pattern, string, flags=0): argument
240 return _compile(pattern, flags).findall(string)
242 def finditer(pattern, string, flags=0): argument
247 return _compile(pattern, flags).finditer(string)
249 def compile(pattern, flags=0): argument
251 return _compile(pattern, flags)
258 def template(pattern, flags=0): argument
260 return _compile(pattern, flags|T)
269 def escape(pattern): argument
273 if isinstance(pattern, str):
274 return pattern.translate(_special_chars_map)
276 pattern = str(pattern, 'latin1')
277 return pattern.translate(_special_chars_map).encode('latin1')
288 def _compile(pattern, flags): argument
293 return _cache[type(pattern), pattern, flags]
296 if isinstance(pattern, Pattern):
300 return pattern
301 if not sre_compile.isstring(pattern):
303 p = sre_compile.compile(pattern, flags)
311 _cache[type(pattern), pattern, flags] = p
315 def _compile_repl(repl, pattern): argument
317 return sre_parse.parse_template(repl, pattern)
319 def _expand(pattern, match, template): argument
321 template = sre_parse.parse_template(template, pattern)
324 def _subx(pattern, template): argument
326 template = _compile_repl(template, pattern)
339 return _compile, (p.pattern, p.flags)