Teks sumber — English
Terjemahan — Bahasa Indonesia
It is important to note that most regular expression operations are available as module-level functions and methods on :ref:`compiled regular expressions <re-objects>`. The functions are shortcuts that don't require you to compile a regex object first, but miss some fine-tuning parameters.
A regular expression (or RE) specifies a set of strings that matches it; the functions in this module let you check if a particular string matches a given regular expression (or if a given regular expression matches a particular string, which comes down to the same thing).
The module defines several functions, constants, and an exception. Some of the functions are simplified versions of the full featured methods for compiled regular expressions. Most non-trivial applications always use the compiled form.
Functions
Fungsi-Fungsi
The compiled versions of the most recent patterns passed to :func:`re.compile` and the module-level matching functions are cached, so programs that use only a few regular expressions at a time needn't worry about compiling regular expressions.
Exception raised when a string passed to one of the functions here is not a valid regular expression (for example, it might contain unmatched parentheses) or when some other error occurs during compilation or matching. It is never an error if a string contains no match for a pattern. The ``PatternError`` instance has the following additional attributes: