Teks sumber — English
Terjemahan — Bahasa Indonesia
Causes the resulting RE to match from *m* to *n* repetitions of the preceding RE, attempting to match as many repetitions as possible *without* establishing any backtracking points. This is the possessive version of the quantifier above. For example, on the 6-character string ``'aaaaaa'``, ``a{3,5}+aa`` attempts to match 5 ``'a'`` characters, then, requiring 2 more ``'a'``\ s, will need more characters than available and thus fail, while ``a{3,5}aa`` will match with ``a{3,5}`` capturing 5, then 4 ``'a'``\ s by backtracking and then the final 2 ``'a'``\ s are matched by the final ``aa`` in the pattern. ``x{m,n}+`` is equivalent to ``(?>x{m,n})``.
Matches any decimal digit in the ASCII character set; this is equivalent to ``[0-9]``.
Matches characters considered whitespace in the ASCII character set; this is equivalent to ``[ \t\n\r\f\v]``.
Matches characters considered alphanumeric in the ASCII character set; this is equivalent to ``[a-zA-Z0-9_]``. If the :py:const:`~re.LOCALE` flag is used, matches characters considered alphanumeric in the current locale and the underscore.
is equivalent to ::
setara dengan::
The optional parameter *endpos* limits how far the string will be searched; it will be as if the string is *endpos* characters long, so only the characters from *pos* to ``endpos - 1`` will be searched for a match. If *endpos* is less than *pos*, no match will be found; otherwise, if *rx* is a compiled regular expression object, ``rx.search(string, 0, 50)`` is equivalent to ``rx.search(string[:50], 0)``. ::