Compile a template pattern, returning a Pattern object, deprecated
(pattern, flags=0)
| 232 | _compile_repl.cache_clear() |
| 233 | |
| 234 | def template(pattern, flags=0): |
| 235 | "Compile a template pattern, returning a Pattern object, deprecated" |
| 236 | import warnings |
| 237 | warnings.warn("The re.template() function is deprecated " |
| 238 | "as it is an undocumented function " |
| 239 | "without an obvious purpose. " |
| 240 | "Use re.compile() instead.", |
| 241 | DeprecationWarning) |
| 242 | with warnings.catch_warnings(): |
| 243 | warnings.simplefilter("ignore", DeprecationWarning) # warn just once |
| 244 | return _compile(pattern, flags|T) |
| 245 | |
| 246 | # SPECIAL_CHARS |
| 247 | # closing ')', '}' and ']' |