# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-13 20:42+0000\n"
"PO-Revision-Date: 2025-09-16 00:01+0000\n"
"Last-Translator: python-doc bot, 2025\n"
"Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/"
"id/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: id\n"
"Plural-Forms: nplurals=1; plural=0;\n"

msgid ":mod:`!re` --- Regular expression operations"
msgstr ""

msgid "**Source code:** :source:`Lib/re/`"
msgstr ""

msgid ""
"This module provides regular expression matching operations similar to those "
"found in Perl."
msgstr ""

msgid ""
"Both patterns and strings to be searched can be Unicode strings "
"(:class:`str`) as well as 8-bit strings (:class:`bytes`). However, Unicode "
"strings and 8-bit strings cannot be mixed: that is, you cannot match a "
"Unicode string with a bytes pattern or vice-versa; similarly, when asking "
"for a substitution, the replacement string must be of the same type as both "
"the pattern and the search string."
msgstr ""

msgid ""
"Regular expressions use the backslash character (``'\\'``) to indicate "
"special forms or to allow special characters to be used without invoking "
"their special meaning.  This collides with Python's usage of the same "
"character for the same purpose in string literals; for example, to match a "
"literal backslash, one might have to write ``'\\\\\\\\'`` as the pattern "
"string, because the regular expression must be ``\\\\``, and each backslash "
"must be expressed as ``\\\\`` inside a regular Python string literal. Also, "
"please note that any invalid escape sequences in Python's usage of the "
"backslash in string literals now generate a :exc:`SyntaxWarning` and in the "
"future this will become a :exc:`SyntaxError`. This behaviour will happen "
"even if it is a valid escape sequence for a regular expression."
msgstr ""

msgid ""
"The solution is to use Python's raw string notation for regular expression "
"patterns; backslashes are not handled in any special way in a string literal "
"prefixed with ``'r'``.  So ``r\"\\n\"`` is a two-character string containing "
"``'\\'`` and ``'n'``, while ``\"\\n\"`` is a one-character string containing "
"a newline.  Usually patterns will be expressed in Python code using this raw "
"string notation."
msgstr ""

msgid ""
"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."
msgstr ""

msgid ""
"The third-party :pypi:`regex` module, which has an API compatible with the "
"standard library :mod:`!re` module, but offers additional functionality and "
"a more thorough Unicode support."
msgstr ""

msgid "Regular expression syntax"
msgstr ""

msgid ""
"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)."
msgstr ""

msgid ""
"Regular expressions can be concatenated to form new regular expressions; if "
"*A* and *B* are both regular expressions, then *AB* is also a regular "
"expression. In general, if a string *p* matches *A* and another string *q* "
"matches *B*, the string *pq* will match AB.  This holds unless *A* or *B* "
"contain low precedence operations; boundary conditions between *A* and *B*; "
"or have numbered group references.  Thus, complex expressions can easily be "
"constructed from simpler primitive expressions like the ones described "
"here.  For details of the theory and implementation of regular expressions, "
"consult the Friedl book [Frie09]_, or almost any textbook about compiler "
"construction."
msgstr ""

msgid ""
"A brief explanation of the format of regular expressions follows.  For "
"further information and a gentler presentation, consult the :ref:`regex-"
"howto`."
msgstr ""

msgid ""
"Regular expressions can contain both special and ordinary characters. Most "
"ordinary characters, like ``'A'``, ``'a'``, or ``'0'``, are the simplest "
"regular expressions; they simply match themselves.  You can concatenate "
"ordinary characters, so ``last`` matches the string ``'last'``.  (In the "
"rest of this section, we'll write RE's in ``this special style``, usually "
"without quotes, and strings to be matched ``'in single quotes'``.)"
msgstr ""

msgid ""
"Some characters, like ``'|'`` or ``'('``, are special. Special characters "
"either stand for classes of ordinary characters, or affect how the regular "
"expressions around them are interpreted."
msgstr ""

msgid ""
"Repetition operators or quantifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) "
"cannot be directly nested. This avoids ambiguity with the non-greedy "
"modifier suffix ``?``, and with other modifiers in other implementations. To "
"apply a second repetition to an inner repetition, parentheses may be used. "
"For example, the expression ``(?:a{6})*`` matches any multiple of six "
"``'a'`` characters."
msgstr ""

msgid "Special characters"
msgstr ""

msgid "The special characters are:"
msgstr ""

msgid "``.``"
msgstr "``.``"

msgid ""
"(Dot.)  In the default mode, this matches any character except a newline.  "
"If the :const:`DOTALL` flag has been specified, this matches any character "
"including a newline.  ``(?s:.)`` matches any character regardless of flags."
msgstr ""

msgid "``^``"
msgstr "``^``"

msgid ""
"(Caret.)  Matches the start of the string, and in :const:`MULTILINE` mode "
"also matches immediately after each newline."
msgstr ""

msgid "``$``"
msgstr "``$``"

msgid ""
"Matches the end of the string or just before the newline at the end of the "
"string, and in :const:`MULTILINE` mode also matches before a newline.  "
"``foo`` matches both 'foo' and 'foobar', while the regular expression "
"``foo$`` matches only 'foo'.  More interestingly, searching for ``foo.$`` in "
"``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' "
"in :const:`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` "
"will find two (empty) matches: one just before the newline, and one at the "
"end of the string."
msgstr ""

msgid "``*``"
msgstr "``*``"

msgid ""
"Causes the resulting RE to match 0 or more repetitions of the preceding RE, "
"as many repetitions as are possible.  ``ab*`` will match 'a', 'ab', or 'a' "
"followed by any number of 'b's."
msgstr ""

msgid "``+``"
msgstr "``+``"

msgid ""
"Causes the resulting RE to match 1 or more repetitions of the preceding RE. "
"``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not "
"match just 'a'."
msgstr ""

msgid "``?``"
msgstr "``?``"

msgid ""
"Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. "
"``ab?`` will match either 'a' or 'ab'."
msgstr ""

msgid "``*?``, ``+?``, ``??``"
msgstr "``*?``, ``+?``, ``??``"

msgid ""
"The ``'*'``, ``'+'``, and ``'?'`` quantifiers are all :dfn:`greedy`; they "
"match as much text as possible.  Sometimes this behaviour isn't desired; if "
"the RE ``<.*>`` is matched against ``'<a> b <c>'``, it will match the entire "
"string, and not just ``'<a>'``.  Adding ``?`` after the quantifier makes it "
"perform the match in :dfn:`non-greedy` or :dfn:`minimal` fashion; as *few* "
"characters as possible will be matched.  Using the RE ``<.*?>`` will match "
"only ``'<a>'``."
msgstr ""

msgid "``*+``, ``++``, ``?+``"
msgstr ""

msgid ""
"Like the ``'*'``, ``'+'``, and ``'?'`` quantifiers, those where ``'+'`` is "
"appended also match as many times as possible. However, unlike the true "
"greedy quantifiers, these do not allow back-tracking when the expression "
"following it fails to match. These are known as :dfn:`possessive` "
"quantifiers. For example, ``a*a`` will match ``'aaaa'`` because the ``a*`` "
"will match all 4 ``'a'``\\ s, but, when the final ``'a'`` is encountered, "
"the expression is backtracked so that in the end the ``a*`` ends up matching "
"3 ``'a'``\\ s total, and the fourth ``'a'`` is matched by the final ``'a'``. "
"However, when ``a*+a`` is used to match ``'aaaa'``, the ``a*+`` will match "
"all 4 ``'a'``, but when the final ``'a'`` fails to find any more characters "
"to match, the expression cannot be backtracked and will thus fail to match. "
"``x*+``, ``x++`` and ``x?+`` are equivalent to ``(?>x*)``, ``(?>x+)`` and "
"``(?>x?)`` correspondingly."
msgstr ""

msgid "``{m}``"
msgstr "``{m}``"

msgid ""
"Specifies that exactly *m* copies of the previous RE should be matched; "
"fewer matches cause the entire RE not to match.  For example, ``a{6}`` will "
"match exactly six ``'a'`` characters, but not five."
msgstr ""

msgid "``{m,n}``"
msgstr "``{m,n}``"

msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as many repetitions as possible.  For "
"example, ``a{3,5}`` will match from 3 to 5 ``'a'`` characters.  Omitting *m* "
"specifies a lower bound of zero,  and omitting *n* specifies an infinite "
"upper bound.  As an example, ``a{4,}b`` will match ``'aaaab'`` or a thousand "
"``'a'`` characters followed by a ``'b'``, but not ``'aaab'``. The comma may "
"not be omitted or the modifier would be confused with the previously "
"described form."
msgstr ""

msgid "``{m,n}?``"
msgstr "``{m,n}?``"

msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as *few* repetitions as possible.  This is "
"the non-greedy version of the previous quantifier.  For example, on the 6-"
"character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters, "
"while ``a{3,5}?`` will only match 3 characters."
msgstr ""

msgid "``{m,n}+``"
msgstr ""

msgid ""
"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})``."
msgstr ""

msgid "``\\``"
msgstr "``\\``"

msgid ""
"Either escapes special characters (permitting you to match characters like "
"``'*'``, ``'?'``, and so forth), or signals a special sequence; special "
"sequences are discussed below."
msgstr ""

msgid ""
"If you're not using a raw string to express the pattern, remember that "
"Python also uses the backslash as an escape sequence in string literals; if "
"the escape sequence isn't recognized by Python's parser, the backslash and "
"subsequent character are included in the resulting string.  However, if "
"Python would recognize the resulting sequence, the backslash should be "
"repeated twice.  This is complicated and hard to understand, so it's highly "
"recommended that you use raw strings for all but the simplest expressions."
msgstr ""

msgid "``[]``"
msgstr "``[]``"

msgid "Used to indicate a set of characters.  In a set:"
msgstr ""

msgid ""
"Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, "
"``'m'``, or ``'k'``."
msgstr ""

msgid ""
"Ranges of characters can be indicated by giving two characters and "
"separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase "
"ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from "
"``00`` to ``59``, and ``[0-9A-Fa-f]`` will match any hexadecimal digit.  If "
"``-`` is escaped (e.g. ``[a\\-z]``) or if it's placed as the first or last "
"character (e.g. ``[-a]`` or ``[a-]``), it will match a literal ``'-'``."
msgstr ""

msgid ""
"Special characters except backslash lose their special meaning inside sets. "
"For example, ``[(+*)]`` will match any of the literal characters ``'('``, "
"``'+'``, ``'*'``, or ``')'``."
msgstr ""

msgid ""
"Backslash either escapes characters which have special meaning in a set such "
"as ``'-'``, ``']'``, ``'^'`` and ``'\\\\'`` itself or signals a special "
"sequence which represents a single character such as ``\\xa0`` or ``\\n`` or "
"a character class such as ``\\w`` or ``\\S`` (defined below). Note that "
"``\\b`` represents a single \"backspace\" character, not a word boundary as "
"outside a set, and numeric escapes such as ``\\1`` are always octal escapes, "
"not group references. Special sequences which do not match a single "
"character such as ``\\A`` and ``\\z`` are not allowed."
msgstr ""

msgid ""
"Characters that are not within a range can be matched "
"by :dfn:`complementing` the set.  If the first character of the set is "
"``'^'``, all the characters that are *not* in the set will be matched.  For "
"example, ``[^5]`` will match any character except ``'5'``, and ``[^^]`` will "
"match any character except ``'^'``.  ``^`` has no special meaning if it's "
"not the first character in the set."
msgstr ""

msgid ""
"To match a literal ``']'`` inside a set, precede it with a backslash, or "
"place it at the beginning of the set.  For example, both ``[()[\\]{}]`` and "
"``[]()[{}]`` will match a right bracket, as well as left bracket, braces, "
"and parentheses."
msgstr ""

msgid ""
"Support of nested sets and set operations as in `Unicode Technical Standard "
"#18`_ might be added in the future.  This would change the syntax, so to "
"facilitate this change a :exc:`FutureWarning` will be raised in ambiguous "
"cases for the time being. That includes sets starting with a literal ``'['`` "
"or containing literal character sequences ``'--'``, ``'&&'``, ``'~~'``, and "
"``'||'``.  To avoid a warning escape them with a backslash."
msgstr ""

msgid ""
":exc:`FutureWarning` is raised if a character set contains constructs that "
"will change semantically in the future."
msgstr ""

msgid "``|``"
msgstr "``|``"

msgid ""
"``A|B``, where *A* and *B* can be arbitrary REs, creates a regular "
"expression that will match either *A* or *B*.  An arbitrary number of REs "
"can be separated by the ``'|'`` in this way.  This can be used inside groups "
"(see below) as well.  As the target string is scanned, REs separated by "
"``'|'`` are tried from left to right. When one pattern completely matches, "
"that branch is accepted. This means that once *A* matches, *B* will not be "
"tested further, even if it would produce a longer overall match.  In other "
"words, the ``'|'`` operator is never greedy.  To match a literal ``'|'``, "
"use ``\\|``, or enclose it inside a character class, as in ``[|]``."
msgstr ""

msgid "``(...)``"
msgstr "``(...)``"

msgid ""
"Matches whatever regular expression is inside the parentheses, and indicates "
"the start and end of a group; the contents of a group can be retrieved after "
"a match has been performed, and can be matched later in the string with the "
"``\\number`` special sequence, described below.  To match the literals "
"``'('`` or ``')'``, use ``\\(`` or ``\\)``, or enclose them inside a "
"character class: ``[(]``, ``[)]``."
msgstr ""

msgid "``(?...)``"
msgstr "``(?...)``"

msgid ""
"This is an extension notation (a ``'?'`` following a ``'('`` is not "
"meaningful otherwise).  The first character after the ``'?'`` determines "
"what the meaning and further syntax of the construct is. Extensions usually "
"do not create a new group; ``(?P<name>...)`` is the only exception to this "
"rule. Following are the currently supported extensions."
msgstr ""

msgid "``(?aiLmsux)``"
msgstr "``(?aiLmsux)``"

msgid ""
"(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
"``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters "
"set the corresponding flags for the entire regular expression:"
msgstr ""

msgid ":const:`re.A` (ASCII-only matching)"
msgstr ""

msgid ":const:`re.I` (ignore case)"
msgstr ""

msgid ":const:`re.L` (locale dependent)"
msgstr ""

msgid ":const:`re.M` (multi-line)"
msgstr ""

msgid ":const:`re.S` (dot matches all)"
msgstr ""

msgid ":const:`re.U` (Unicode matching)"
msgstr ""

msgid ":const:`re.X` (verbose)"
msgstr ""

msgid ""
"(The flags are described in :ref:`contents-of-module-re`.) This is useful if "
"you wish to include the flags as part of the regular expression, instead of "
"passing a *flag* argument to the :func:`re.compile` function. Flags should "
"be used first in the expression string."
msgstr ""

msgid "This construction can only be used at the start of the expression."
msgstr ""

msgid "``(?:...)``"
msgstr "``(?:...)``"

msgid ""
"A non-capturing version of regular parentheses.  Matches whatever regular "
"expression is inside the parentheses, but the substring matched by the group "
"*cannot* be retrieved after performing a match or referenced later in the "
"pattern."
msgstr ""

msgid "``(?aiLmsux-imsx:...)``"
msgstr "``(?aiLmsux-imsx:...)``"

msgid ""
"(Zero or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
"``'s'``, ``'u'``, ``'x'``, optionally followed by ``'-'`` followed by one or "
"more letters from the ``'i'``, ``'m'``, ``'s'``, ``'x'``.) The letters set "
"or remove the corresponding flags for the part of the expression:"
msgstr ""

msgid "(The flags are described in :ref:`contents-of-module-re`.)"
msgstr ""

msgid ""
"The letters ``'a'``, ``'L'`` and ``'u'`` are mutually exclusive when used as "
"inline flags, so they can't be combined or follow ``'-'``.  Instead, when "
"one of them appears in an inline group, it overrides the matching mode in "
"the enclosing group.  In Unicode patterns ``(?a:...)`` switches to ASCII-"
"only matching, and ``(?u:...)`` switches to Unicode matching (default).  In "
"bytes patterns ``(?L:...)`` switches to locale dependent matching, and ``(?"
"a:...)`` switches to ASCII-only matching (default). This override is only in "
"effect for the narrow inline group, and the original matching mode is "
"restored outside of the group."
msgstr ""

msgid "The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group."
msgstr ""

msgid "``(?>...)``"
msgstr ""

msgid ""
"Attempts to match ``...`` as if it was a separate regular expression, and if "
"successful, continues to match the rest of the pattern following it. If the "
"subsequent pattern fails to match, the stack can only be unwound to a point "
"*before* the ``(?>...)`` because once exited, the expression, known as "
"an :dfn:`atomic group`, has thrown away all stack points within itself. "
"Thus, ``(?>.*).`` would never match anything because first the ``.*`` would "
"match all characters possible, then, having nothing left to match, the final "
"``.`` would fail to match. Since there are no stack points saved in the "
"Atomic Group, and there is no stack point before it, the entire expression "
"would thus fail to match."
msgstr ""

msgid "``(?P<name>...)``"
msgstr "``(?P<name>...)``"

msgid ""
"Similar to regular parentheses, but the substring matched by the group is "
"accessible via the symbolic group name *name*.  Group names must be valid "
"Python identifiers, and in :class:`bytes` patterns they can only contain "
"bytes in the ASCII range.  Each group name must be defined only once within "
"a regular expression.  A symbolic group is also a numbered group, just as if "
"the group were not named."
msgstr ""

msgid ""
"Named groups can be referenced in three contexts.  If the pattern is ``(?"
"P<quote>['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either "
"single or double quotes):"
msgstr ""

msgid "Context of reference to group \"quote\""
msgstr ""

msgid "Ways to reference it"
msgstr ""

msgid "in the same pattern itself"
msgstr ""

msgid "``(?P=quote)`` (as shown)"
msgstr ""

msgid "``\\1``"
msgstr "``\\1``"

msgid "when processing match object *m*"
msgstr ""

msgid "``m.group('quote')``"
msgstr ""

msgid "``m.end('quote')`` (etc.)"
msgstr ""

msgid "in a string passed to the *repl* argument of ``re.sub()``"
msgstr ""

msgid "``\\g<quote>``"
msgstr "``\\g<quote>``"

msgid "``\\g<1>``"
msgstr "``\\g<1>``"

msgid ""
"In :class:`bytes` patterns, group *name* can only contain bytes in the ASCII "
"range (``b'\\x00'``-``b'\\x7f'``)."
msgstr ""

msgid "``(?P=name)``"
msgstr "``(?P=name)``"

msgid ""
"A backreference to a named group; it matches whatever text was matched by "
"the earlier group named *name*."
msgstr ""

msgid "``(?#...)``"
msgstr "``(?#...)``"

msgid "A comment; the contents of the parentheses are simply ignored."
msgstr ""

msgid "``(?=...)``"
msgstr "``(?=...)``"

msgid ""
"Matches if ``...`` matches next, but doesn't consume any of the string.  "
"This is called a :dfn:`lookahead assertion`.  For example, ``Isaac (?"
"=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``."
msgstr ""

msgid "``(?!...)``"
msgstr "``(?!...)``"

msgid ""
"Matches if ``...`` doesn't match next.  This is a :dfn:`negative lookahead "
"assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only "
"if it's *not* followed by ``'Asimov'``."
msgstr ""

msgid "``(?<=...)``"
msgstr "``(?<=...)``"

msgid ""
"Matches if the current position in the string is preceded by a match for "
"``...`` that ends at the current position.  This is called a :dfn:`positive "
"lookbehind assertion`. ``(?<=abc)def`` will find a match in ``'abcdef'``, "
"since the lookbehind will back up 3 characters and check if the contained "
"pattern matches. The contained pattern must only match strings of some fixed "
"length, meaning that ``abc`` or ``a|b`` are allowed, but ``a*`` and ``a{3,4}"
"`` are not.  Note that patterns which start with positive lookbehind "
"assertions will not match at the beginning of the string being searched; you "
"will most likely want to use the :func:`search` function rather than "
"the :func:`match` function:"
msgstr ""

msgid "This example looks for a word following a hyphen:"
msgstr ""

msgid "Added support for group references of fixed length."
msgstr ""

msgid "``(?<!...)``"
msgstr "``(?<!...)``"

msgid ""
"Matches if the current position in the string is not preceded by a match for "
"``...``.  This is called a :dfn:`negative lookbehind assertion`.  Similar to "
"positive lookbehind assertions, the contained pattern must only match "
"strings of some fixed length.  Patterns which start with negative lookbehind "
"assertions may match at the beginning of the string being searched."
msgstr ""

msgid "``(?(id/name)yes-pattern|no-pattern)``"
msgstr "``(?(id/name)yes-pattern|no-pattern)``"

msgid ""
"Will try to match with ``yes-pattern`` if the group with given *id* or "
"*name* exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is "
"optional and can be omitted. For example, ``(<)?(\\w+@\\w+(?:\\.\\w+)+)(?"
"(1)>|$)`` is a poor email matching pattern, which matches "
"``'<user@host.com>'`` as well as ``'user@host.com'``, but does not match "
"``'<user@host.com'`` nor ``'user@host.com>'`` in their entirety "
"(:func:`re.search` finds only ``'user@host.com'`` in the former)."
msgstr ""

msgid ""
"Group *id* can only contain ASCII digits. In :class:`bytes` patterns, group "
"*name* can only contain bytes in the ASCII range (``b'\\x00'``-``b'\\x7f'``)."
msgstr ""

msgid "Special sequences"
msgstr ""

msgid ""
"The special sequences consist of ``'\\'`` and a character from the list "
"below. If the ordinary character is not an ASCII digit or an ASCII letter, "
"then the resulting RE will match the second character.  For example, ``\\$`` "
"matches the character ``'$'``."
msgstr ""

msgid "``\\number``"
msgstr "``\\number``"

msgid ""
"Matches the contents of the group of the same number.  Groups are numbered "
"starting from 1.  For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 "
"55'``, but not ``'thethe'`` (note the space after the group).  This special "
"sequence can only be used to match one of the first 99 groups.  If the first "
"digit of *number* is 0, or *number* is 3 octal digits long, it will not be "
"interpreted as a group match, but as the character with octal value "
"*number*. Inside the ``'['`` and ``']'`` of a character class, all numeric "
"escapes are treated as characters."
msgstr ""

msgid "``\\A``"
msgstr "``\\A``"

msgid "Matches only at the start of the string."
msgstr ""

msgid "``\\b``"
msgstr "``\\b``"

msgid ""
"Matches the empty string, but only at the beginning or end of a word. A word "
"is defined as a sequence of word characters. Note that formally, ``\\b`` is "
"defined as the boundary between a ``\\w`` and a ``\\W`` character (or vice "
"versa), or between ``\\w`` and the beginning or end of the string. This "
"means that ``r'\\bat\\b'`` matches ``'at'``, ``'at.'``, ``'(at)'``, and "
"``'as at ay'`` but not ``'attempt'`` or ``'atlas'``."
msgstr ""

msgid ""
"The default word characters in Unicode (str) patterns are Unicode "
"alphanumerics and the underscore, but this can be changed by using "
"the :py:const:`~re.ASCII` flag. Word boundaries are determined by the "
"current locale if the :py:const:`~re.LOCALE` flag is used."
msgstr ""

msgid ""
"Inside a character range, ``\\b`` represents the backspace character, for "
"compatibility with Python's string literals."
msgstr ""

msgid "``\\B``"
msgstr "``\\B``"

msgid ""
"Matches the empty string, but only when it is *not* at the beginning or end "
"of a word. This means that ``r'at\\B'`` matches ``'athens'``, ``'atom'``, "
"``'attorney'``, but not ``'at'``, ``'at.'``, or ``'at!'``. ``\\B`` is the "
"opposite of ``\\b``, so word characters in Unicode (str) patterns are "
"Unicode alphanumerics or the underscore, although this can be changed by "
"using the :py:const:`~re.ASCII` flag. Word boundaries are determined by the "
"current locale if the :py:const:`~re.LOCALE` flag is used."
msgstr ""

msgid "``\\B`` now matches empty input string."
msgstr ""

msgid "``\\d``"
msgstr "``\\d``"

msgid "For Unicode (str) patterns:"
msgstr ""

msgid ""
"Matches any Unicode decimal digit (that is, any character in Unicode "
"character category `[Nd]`__). This includes ``[0-9]``, and also many other "
"digit characters."
msgstr ""

msgid "Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""

msgid "For 8-bit (bytes) patterns:"
msgstr ""

msgid ""
"Matches any decimal digit in the ASCII character set; this is equivalent to "
"``[0-9]``."
msgstr ""

msgid "``\\D``"
msgstr "``\\D``"

msgid ""
"Matches any character which is not a decimal digit. This is the opposite of "
"``\\d``."
msgstr ""

msgid "Matches ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""

msgid "``\\s``"
msgstr "``\\s``"

msgid ""
"Matches Unicode whitespace characters (as defined "
"by :py:meth:`str.isspace`). This includes ``[ \\t\\n\\r\\f\\v]``, and also "
"many other characters, for example the non-breaking spaces mandated by "
"typography rules in many languages."
msgstr ""

msgid ""
"Matches ``[ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""

msgid ""
"Matches characters considered whitespace in the ASCII character set; this is "
"equivalent to ``[ \\t\\n\\r\\f\\v]``."
msgstr ""

msgid "``\\S``"
msgstr "``\\S``"

msgid ""
"Matches any character which is not a whitespace character. This is the "
"opposite of ``\\s``."
msgstr ""

msgid ""
"Matches ``[^ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""

msgid "``\\w``"
msgstr "``\\w``"

msgid ""
"Matches Unicode word characters; this includes all Unicode alphanumeric "
"characters (as defined by :py:meth:`str.isalnum`), as well as the underscore "
"(``_``)."
msgstr ""

msgid "Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""

msgid ""
"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."
msgstr ""

msgid "``\\W``"
msgstr "``\\W``"

msgid ""
"Matches any character which is not a word character. This is the opposite of "
"``\\w``. By default, matches non-underscore (``_``) characters for "
"which :py:meth:`str.isalnum` returns ``False``."
msgstr ""

msgid "Matches ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used."
msgstr ""

msgid ""
"If the :py:const:`~re.LOCALE` flag is used, matches characters which are "
"neither alphanumeric in the current locale nor the underscore."
msgstr ""

msgid "``\\z``"
msgstr ""

msgid "Matches only at the end of the string."
msgstr ""

msgid "``\\Z``"
msgstr "``\\Z``"

msgid "The same as ``\\z``.  For compatibility with old Python versions."
msgstr ""

msgid "Standard escapes"
msgstr ""

msgid ""
"Most of the :ref:`escape sequences <escape-sequences>` supported by Python "
"string literals are also accepted by the regular expression parser::"
msgstr ""

msgid ""
"\\a      \\b      \\f      \\n\n"
"\\N      \\r      \\t      \\u\n"
"\\U      \\v      \\x      \\\\"
msgstr ""

msgid ""
"(Note that ``\\b`` is used to represent word boundaries, and means "
"\"backspace\" only inside character classes.)"
msgstr ""

msgid ""
"``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in "
"Unicode (str) patterns. In bytes patterns they are errors. Unknown escapes "
"of ASCII letters are reserved for future use and treated as errors."
msgstr ""

msgid ""
"Octal escapes are included in a limited form.  If the first digit is a 0, or "
"if there are three octal digits, it is considered an octal escape. "
"Otherwise, it is a group reference.  As for string literals, octal escapes "
"are always at most three digits in length."
msgstr ""

msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added."
msgstr ""

msgid ""
"Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors."
msgstr ""

msgid ""
"The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in "
"string literals, it expands to the named Unicode character (e.g. ``'\\N{EM "
"DASH}'``)."
msgstr ""

msgid "Module contents"
msgstr ""

msgid ""
"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."
msgstr ""

msgid "Flags"
msgstr ""

msgid ""
"Flag constants are now instances of :class:`RegexFlag`, which is a subclass "
"of :class:`enum.IntFlag`."
msgstr ""

msgid ""
"An :class:`enum.IntFlag` class containing the regex options listed below."
msgstr ""

msgid "- added to ``__all__``"
msgstr ""

msgid ""
"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and "
"``\\S`` perform ASCII-only matching instead of full Unicode matching.  This "
"is only meaningful for Unicode (str) patterns, and is ignored for bytes "
"patterns."
msgstr ""

msgid "Corresponds to the inline flag ``(?a)``."
msgstr ""

msgid ""
"The :py:const:`~re.U` flag still exists for backward compatibility, but is "
"redundant in Python 3 since matches are Unicode by default for ``str`` "
"patterns, and Unicode matching isn't allowed for bytes "
"patterns. :py:const:`~re.UNICODE` and the inline flag ``(?u)`` are similarly "
"redundant."
msgstr ""

msgid "Display debug information about compiled expression."
msgstr ""

msgid "No corresponding inline flag."
msgstr ""

msgid ""
"Perform case-insensitive matching; expressions like ``[A-Z]`` will also  "
"match lowercase letters. Full Unicode matching (such as ``Ü`` matching "
"``ü``) also works unless the :py:const:`~re.ASCII` flag is used to disable "
"non-ASCII matches. The current locale does not change the effect of this "
"flag unless the :py:const:`~re.LOCALE` flag is also used."
msgstr ""

msgid "Corresponds to the inline flag ``(?i)``."
msgstr ""

msgid ""
"Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in "
"combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII "
"letters and 4 additional non-ASCII letters: 'İ' (U+0130, Latin capital "
"letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), 'ſ' "
"(U+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). If "
"the :py:const:`~re.ASCII` flag is used, only letters 'a' to 'z' and 'A' to "
"'Z' are matched."
msgstr ""

msgid ""
"Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching "
"dependent on the current locale. This flag can be used only with bytes "
"patterns."
msgstr ""

msgid "Corresponds to the inline flag ``(?L)``."
msgstr ""

msgid ""
"This flag is discouraged; consider Unicode matching instead. The locale "
"mechanism is very unreliable as it only handles one \"culture\" at a time "
"and only works with 8-bit locales. Unicode matching is enabled by default "
"for Unicode (str) patterns and it is able to handle different locales and "
"languages."
msgstr ""

msgid ""
":py:const:`~re.LOCALE` can be used only with bytes patterns and is not "
"compatible with :py:const:`~re.ASCII`."
msgstr ""

msgid ""
"Compiled regular expression objects with the :py:const:`~re.LOCALE` flag no "
"longer depend on the locale at compile time. Only the locale at matching "
"time affects the result of matching."
msgstr ""

msgid ""
"When specified, the pattern character ``'^'`` matches at the beginning of "
"the string and at the beginning of each line (immediately following each "
"newline); and the pattern character ``'$'`` matches at the end of the string "
"and at the end of each line (immediately preceding each newline).  By "
"default, ``'^'`` matches only at the beginning of the string, and ``'$'`` "
"only at the end of the string and immediately before the newline (if any) at "
"the end of the string."
msgstr ""

msgid "Corresponds to the inline flag ``(?m)``."
msgstr ""

msgid ""
"Indicates no flag being applied, the value is ``0``.  This flag may be used "
"as a default value for a function keyword argument or as a base value that "
"will be conditionally ORed with other flags.  Example of use as a default "
"value::"
msgstr ""

msgid ""
"def myfunc(pattern, text, flag=re.NOFLAG):\n"
"    return re.search(pattern, text, flag)"
msgstr ""

msgid ""
"Make the ``'.'`` special character match any character at all, including a "
"newline; without this flag, ``'.'`` will match anything *except* a newline."
msgstr ""

msgid "Corresponds to the inline flag ``(?s)``."
msgstr ""

msgid ""
"In Python 3, Unicode characters are matched by default for ``str`` patterns. "
"This flag is therefore redundant with **no effect** and is only kept for "
"backward compatibility."
msgstr ""

msgid ""
"See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead."
msgstr ""

msgid ""
"This flag allows you to write regular expressions that look nicer and are "
"more readable by allowing you to visually separate logical sections of the "
"pattern and add comments. Whitespace within the pattern is ignored, except "
"when in a character class, or when preceded by an unescaped backslash, or "
"within tokens like ``*?``, ``(?:`` or ``(?P<...>``. For example, ``(? :`` "
"and ``* ?`` are not allowed. When a line contains a ``#`` that is not in a "
"character class and is not preceded by an unescaped backslash, all "
"characters from the leftmost such ``#`` through the end of the line are "
"ignored."
msgstr ""

msgid ""
"This means that the two following regular expression objects that match a "
"decimal number are functionally equal::"
msgstr ""

msgid ""
"a = re.compile(r\"\"\"\\d +  # the integral part\n"
"                   \\.    # the decimal point\n"
"                   \\d *  # some fractional digits\"\"\", re.X)\n"
"b = re.compile(r\"\\d+\\.\\d*\")"
msgstr ""

msgid "Corresponds to the inline flag ``(?x)``."
msgstr ""

msgid "Functions"
msgstr "Fungsi-Fungsi"

msgid ""
"Compile a regular expression pattern into a :ref:`regular expression object "
"<re-objects>`, which can be used for matching using "
"its :func:`~Pattern.prefixmatch`, :func:`~Pattern.search`, and other "
"methods, described below."
msgstr ""

msgid ""
"The expression's behaviour can be modified by specifying a *flags* value. "
"Values can be any of the `flags`_ variables, combined using bitwise OR (the "
"``|`` operator)."
msgstr ""

msgid "The sequence ::"
msgstr ""

msgid ""
"prog = re.compile(pattern)\n"
"result = prog.search(string)"
msgstr ""

msgid "is equivalent to ::"
msgstr "setara dengan::"

msgid "result = re.search(pattern, string)"
msgstr ""

msgid ""
"but using :func:`re.compile` and saving the resulting regular expression "
"object for reuse is more efficient when the expression will be used several "
"times in a single program."
msgstr ""

msgid ""
"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."
msgstr ""

msgid ""
"Scan through *string* looking for the first location where the regular "
"expression *pattern* produces a match, and return a "
"corresponding :class:`~re.Match`. Return ``None`` if no position in the "
"string matches the pattern; note that this is different from finding a zero-"
"length match at some point in the string."
msgstr ""

msgid ""
"If zero or more characters at the beginning of *string* match the regular "
"expression *pattern*, return a corresponding :class:`~re.Match`.  Return "
"``None`` if the string does not match the pattern; note that this is "
"different from a zero-length match."
msgstr ""

msgid ""
"Even in :const:`MULTILINE` mode, this will only match at the beginning of "
"the string and not at the beginning of each line."
msgstr ""

msgid ""
"If you want to locate a match anywhere in *string*, use :func:`search` "
"instead (see also :ref:`search-vs-match`)."
msgstr ""

msgid ""
"This function now has two names and has long been known "
"as :func:`~re.match`.  Use that name when you need to retain compatibility "
"with older Python versions."
msgstr ""

msgid ""
":func:`~re.match` has been :term:`soft deprecated` in favor of the "
"alternate :func:`~re.prefixmatch` name of this API which is more explicitly "
"descriptive. Use it to better express intent. The norm in other languages "
"and regular expression implementations is to use the term *match* to refer "
"to the behavior of what Python has always called :func:`~re.search`. "
"See :ref:`prefixmatch-vs-match`."
msgstr ""

msgid ""
"If the whole *string* matches the regular expression *pattern*, return a "
"corresponding :class:`~re.Match`.  Return ``None`` if the string does not "
"match the pattern; note that this is different from a zero-length match."
msgstr ""

msgid ""
"Split *string* by the occurrences of *pattern*.  If capturing parentheses "
"are used in *pattern*, then the text of all groups in the pattern are also "
"returned as part of the resulting list. If *maxsplit* is nonzero, at most "
"*maxsplit* splits occur, and the remainder of the string is returned as the "
"final element of the list. ::"
msgstr ""

msgid ""
">>> re.split(r'\\W+', 'Words, words, words.')\n"
"['Words', 'words', 'words', '']\n"
">>> re.split(r'(\\W+)', 'Words, words, words.')\n"
"['Words', ', ', 'words', ', ', 'words', '.', '']\n"
">>> re.split(r'\\W+', 'Words, words, words.', maxsplit=1)\n"
"['Words', 'words, words.']\n"
">>> re.split('[a-f]+', '0a3B9', flags=re.IGNORECASE)\n"
"['0', '3', '9']"
msgstr ""

msgid ""
"If there are capturing groups in the separator and it matches at the start "
"of the string, the result will start with an empty string.  The same holds "
"for the end of the string::"
msgstr ""

msgid ""
">>> re.split(r'(\\W+)', '...words, words...')\n"
"['', '...', 'words', ', ', 'words', '...', '']"
msgstr ""

msgid ""
"That way, separator components are always found at the same relative indices "
"within the result list."
msgstr ""

msgid ""
"Adjacent empty matches are not possible, but an empty match can occur "
"immediately after a non-empty match."
msgstr ""

msgid ""
">>> re.split(r'\\b', 'Words, words, words.')\n"
"['', 'Words', ', ', 'words', ', ', 'words', '.']\n"
">>> re.split(r'\\W*', '...words...')\n"
"['', '', 'w', 'o', 'r', 'd', 's', '', '']\n"
">>> re.split(r'(\\W*)', '...words...')\n"
"['', '...', '', '', 'w', '', 'o', '', 'r', '', 'd', '', 's', '...', '', '', "
"'']"
msgstr ""

msgid "Added the optional flags argument."
msgstr ""

msgid ""
"Added support of splitting on a pattern that could match an empty string."
msgstr ""

msgid ""
"Passing *maxsplit* and *flags* as positional arguments is deprecated. In "
"future Python versions they will be :ref:`keyword-only parameters <keyword-"
"only_parameter>`."
msgstr ""

msgid ""
"Return all non-overlapping matches of *pattern* in *string*, as a list of "
"strings or tuples.  The *string* is scanned left-to-right, and matches are "
"returned in the order found.  Empty matches are included in the result."
msgstr ""

msgid ""
"The result depends on the number of capturing groups in the pattern. If "
"there are no groups, return a list of strings matching the whole pattern.  "
"If there is exactly one group, return a list of strings matching that "
"group.  If multiple groups are present, return a list of tuples of strings "
"matching the groups.  Non-capturing groups do not affect the form of the "
"result."
msgstr ""

msgid "Non-empty matches can now start just after a previous empty match."
msgstr ""

msgid ""
"Return an :term:`iterator` yielding :class:`~re.Match` objects over all non-"
"overlapping matches for the RE *pattern* in *string*.  The *string* is "
"scanned left-to-right, and matches are returned in the order found.  Empty "
"matches are included in the result."
msgstr ""

msgid ""
"Return the string obtained by replacing the leftmost non-overlapping "
"occurrences of *pattern* in *string* by the replacement *repl*.  If the "
"pattern isn't found, *string* is returned unchanged.  *repl* can be a string "
"or a function; if it is a string, any backslash escapes in it are "
"processed.  That is, ``\\n`` is converted to a single newline character, "
"``\\r`` is converted to a carriage return, and so forth.  Unknown escapes of "
"ASCII letters are reserved for future use and treated as errors.  Other "
"unknown escapes such as ``\\&`` are left alone. Backreferences, such as "
"``\\6``, are replaced with the substring matched by group 6 in the pattern. "
"For example::"
msgstr ""

msgid ""
">>> re.sub(r'def\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(\\s*\\):',\n"
"...        r'static PyObject*\\npy_\\1(void)\\n{',\n"
"...        'def myfunc():')\n"
"'static PyObject*\\npy_myfunc(void)\\n{'"
msgstr ""

msgid ""
"If *repl* is a function, it is called for every non-overlapping occurrence "
"of *pattern*.  The function takes a single :class:`~re.Match` argument, and "
"returns the replacement string.  For example::"
msgstr ""

msgid ""
">>> def dashrepl(matchobj):\n"
"...     if matchobj.group(0) == '-': return ' '\n"
"...     else: return '-'\n"
"...\n"
">>> re.sub('-{1,2}', dashrepl, 'pro----gram-files')\n"
"'pro--gram files'\n"
">>> re.sub(r'\\sAND\\s', ' & ', 'Baked Beans And Spam', "
"flags=re.IGNORECASE)\n"
"'Baked Beans & Spam'"
msgstr ""

msgid "The pattern may be a string or a :class:`~re.Pattern`."
msgstr ""

msgid ""
"The optional argument *count* is the maximum number of pattern occurrences "
"to be replaced; *count* must be a non-negative integer.  If omitted or zero, "
"all occurrences will be replaced."
msgstr ""

msgid ""
"Adjacent empty matches are not possible, but an empty match can occur "
"immediately after a non-empty match. As a result, ``sub('x*', '-', 'abxd')`` "
"returns ``'-a-b--d-'`` instead of ``'-a-b-d-'``."
msgstr ""

msgid ""
"In string-type *repl* arguments, in addition to the character escapes and "
"backreferences described above, ``\\g<name>`` will use the substring matched "
"by the group named ``name``, as defined by the ``(?P<name>...)`` syntax. "
"``\\g<number>`` uses the corresponding group number; ``\\g<2>`` is therefore "
"equivalent to ``\\2``, but isn't ambiguous in a replacement such as "
"``\\g<2>0``.  ``\\20`` would be interpreted as a reference to group 20, not "
"a reference to group 2 followed by the literal character ``'0'``.  The "
"backreference ``\\g<0>`` substitutes in the entire substring matched by the "
"RE."
msgstr ""

msgid "Unmatched groups are replaced with an empty string."
msgstr ""

msgid ""
"Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now "
"are errors."
msgstr ""

msgid ""
"Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are "
"errors. An empty match can occur immediately after a non-empty match."
msgstr ""

msgid ""
"Group *id* can only contain ASCII digits. In :class:`bytes` replacement "
"strings, group *name* can only contain bytes in the ASCII range "
"(``b'\\x00'``-``b'\\x7f'``)."
msgstr ""

msgid ""
"Passing *count* and *flags* as positional arguments is deprecated. In future "
"Python versions they will be :ref:`keyword-only parameters <keyword-"
"only_parameter>`."
msgstr ""

msgid ""
"Perform the same operation as :func:`sub`, but return a tuple ``(new_string, "
"number_of_subs_made)``."
msgstr ""

msgid ""
"Escape special characters in *pattern*. This is useful if you want to match "
"an arbitrary literal string that may have regular expression metacharacters "
"in it.  For example::"
msgstr ""

msgid ""
">>> print(re.escape('https://www.python.org'))\n"
"https://www\\.python\\.org\n"
"\n"
">>> legal_chars = string.ascii_lowercase + string.digits + \"!#$%&'*+-.^_`|~:"
"\"\n"
">>> print('[%s]+' % re.escape(legal_chars))\n"
"[abcdefghijklmnopqrstuvwxyz0123456789!\\#\\$%\\&'\\*\\+\\-\\.\\^_`\\|\\~:]+\n"
"\n"
">>> operators = ['+', '-', '*', '/', '**']\n"
">>> print('|'.join(map(re.escape, sorted(operators, reverse=True))))\n"
"/|\\-|\\+|\\*\\*|\\*"
msgstr ""

msgid ""
"This function must not be used for the replacement string in :func:`sub` "
"and :func:`subn`, only backslashes should be escaped.  For example::"
msgstr ""

msgid ""
">>> digits_re = r'\\d+'\n"
">>> sample = '/usr/sbin/sendmail - 0 errors, 12 warnings'\n"
">>> print(re.sub(digits_re, digits_re.replace('\\\\', r'\\\\'), sample))\n"
"/usr/sbin/sendmail - \\d+ errors, \\d+ warnings"
msgstr ""

msgid "The ``'_'`` character is no longer escaped."
msgstr ""

msgid ""
"Only characters that can have special meaning in a regular expression are "
"escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, "
"``'/'``, ``':'``, ``';'``, ``'<'``, ``'='``, ``'>'``, ``'@'``, and ``\"`\"`` "
"are no longer escaped."
msgstr ""

msgid "Clear the regular expression cache."
msgstr ""

msgid "Exceptions"
msgstr "Pengecualian"

msgid ""
"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:"
msgstr ""

msgid "The unformatted error message."
msgstr ""

msgid "The regular expression pattern."
msgstr ""

msgid "The index in *pattern* where compilation failed (may be ``None``)."
msgstr ""

msgid "The line corresponding to *pos* (may be ``None``)."
msgstr ""

msgid "The column corresponding to *pos* (may be ``None``)."
msgstr ""

msgid "Added additional attributes."
msgstr ""

msgid ""
"``PatternError`` was originally named ``error``; the latter is kept as an "
"alias for backward compatibility."
msgstr ""

msgid "Regular expression objects"
msgstr ""

msgid "Compiled regular expression object returned by :func:`re.compile`."
msgstr ""

msgid ""
"Patterns are :ref:`generic <generics>` over the type of string they handle "
"(:class:`str` or :class:`bytes`)."
msgstr ""

msgid ""
":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes "
"pattern. See :ref:`types-genericalias`."
msgstr ""

msgid ""
"Scan through *string* looking for the first location where this regular "
"expression produces a match, and return a corresponding :class:`~re.Match`. "
"Return ``None`` if no position in the string matches the pattern; note that "
"this is different from finding a zero-length match at some point in the "
"string."
msgstr ""

msgid ""
"The optional second parameter *pos* gives an index in the string where the "
"search is to start; it defaults to ``0``.  This is not completely equivalent "
"to slicing the string; the ``'^'`` pattern character matches at the real "
"beginning of the string and at positions just after a newline, but not "
"necessarily at the index where the search is to start."
msgstr ""

msgid ""
"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)``. ::"
msgstr ""

msgid ""
">>> pattern = re.compile(\"d\")\n"
">>> pattern.search(\"dog\")     # Match at index 0\n"
"<re.Match object; span=(0, 1), match='d'>\n"
">>> pattern.search(\"dog\", 1)  # No match; search doesn't include the \"d\""
msgstr ""

msgid ""
"If zero or more characters at the *beginning* of *string* match this regular "
"expression, return a corresponding :class:`~re.Match`. Return ``None`` if "
"the string does not match the pattern; note that this is different from a "
"zero-length match."
msgstr ""

msgid ""
"Note that even in :const:`MULTILINE` mode, this will only match at the "
"beginning of the string and not at the beginning of each line."
msgstr ""

msgid ""
"The optional *pos* and *endpos* parameters have the same meaning as for "
"the :meth:`~Pattern.search` method. ::"
msgstr ""

msgid ""
">>> pattern = re.compile(\"o\")\n"
">>> pattern.prefixmatch(\"dog\")     # No match as \"o\" is not at the start "
"of \"dog\".\n"
">>> pattern.prefixmatch(\"dog\", 1)  # Match as \"o\" is the 2nd character "
"of \"dog\".\n"
"<re.Match object; span=(1, 2), match='o'>"
msgstr ""

msgid ""
"If you want to locate a match anywhere in *string*, "
"use :meth:`~Pattern.search` instead (see also :ref:`search-vs-match`)."
msgstr ""

msgid ""
"This method now has two names and has long been known "
"as :meth:`~Pattern.match`.  Use that name when you need to retain "
"compatibility with older Python versions."
msgstr ""

msgid ""
":meth:`~Pattern.match` has been :term:`soft deprecated` in favor of the "
"alternate :meth:`~Pattern.prefixmatch` name of this API which is more "
"explicitly descriptive. Use it to better express intent. The norm in other "
"languages and regular expression implementations is to use the term *match* "
"to refer to the behavior of what Python has always "
"called :meth:`~Pattern.search`. See :ref:`prefixmatch-vs-match`."
msgstr ""

msgid ""
"If the whole *string* matches this regular expression, return a "
"corresponding :class:`~re.Match`.  Return ``None`` if the string does not "
"match the pattern; note that this is different from a zero-length match."
msgstr ""

msgid ""
">>> pattern = re.compile(\"o[gh]\")\n"
">>> pattern.fullmatch(\"dog\")      # No match as \"o\" is not at the start "
"of \"dog\".\n"
">>> pattern.fullmatch(\"ogre\")     # No match as not the full string "
"matches.\n"
">>> pattern.fullmatch(\"doggie\", 1, 3)   # Matches within given limits.\n"
"<re.Match object; span=(1, 3), match='og'>"
msgstr ""

msgid "Identical to the :func:`split` function, using the compiled pattern."
msgstr ""

msgid ""
"Similar to the :func:`findall` function, using the compiled pattern, but "
"also accepts optional *pos* and *endpos* parameters that limit the search "
"region like for :meth:`search`."
msgstr ""

msgid ""
"Similar to the :func:`finditer` function, using the compiled pattern, but "
"also accepts optional *pos* and *endpos* parameters that limit the search "
"region like for :meth:`search`."
msgstr ""

msgid "Identical to the :func:`sub` function, using the compiled pattern."
msgstr ""

msgid "Identical to the :func:`subn` function, using the compiled pattern."
msgstr ""

msgid ""
"The regex matching flags.  This is a combination of the flags given "
"to :func:`.compile`, any ``(?...)`` inline flags in the pattern, and "
"implicit flags such as :py:const:`~re.UNICODE` if the pattern is a Unicode "
"string."
msgstr ""

msgid "The number of capturing groups in the pattern."
msgstr ""

msgid ""
"A dictionary mapping any symbolic group names defined by ``(?P<id>)`` to "
"group numbers.  The dictionary is empty if no symbolic groups were used in "
"the pattern."
msgstr ""

msgid "The pattern string from which the pattern object was compiled."
msgstr ""

msgid ""
"Added support of :func:`copy.copy` and :func:`copy.deepcopy`.  Compiled "
"regular expression objects are considered atomic."
msgstr ""

msgid "Match objects"
msgstr ""

msgid ""
"Match objects always have a boolean value of ``True``. "
"Since :meth:`~Pattern.match` and :meth:`~Pattern.search` return ``None`` "
"when there is no match, you can test whether there was a match with a simple "
"``if`` statement::"
msgstr ""

msgid ""
"if match := re.search(pattern, string):\n"
"    process(match)"
msgstr ""

msgid "Match object returned by successful ``match``\\ es and ``search``\\ es."
msgstr ""

msgid ""
"Matches are :ref:`generic <generics>` over the type of string which was "
"matched (:class:`str` or :class:`bytes`)."
msgstr ""

msgid ""
":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes "
"match. See :ref:`types-genericalias`."
msgstr ""

msgid ""
"Return the string obtained by doing backslash substitution on the template "
"string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such "
"as ``\\n`` are converted to the appropriate characters, and numeric "
"backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, "
"``\\g<name>``) are replaced by the contents of the corresponding group. The "
"backreference ``\\g<0>`` will be replaced by the entire match."
msgstr ""

msgid ""
"Returns one or more subgroups of the match.  If there is a single argument, "
"the result is a single string; if there are multiple arguments, the result "
"is a tuple with one item per argument. Without arguments, *group1* defaults "
"to zero (the whole match is returned). If a *groupN* argument is zero, the "
"corresponding return value is the entire matching string; if it is a "
"positive integer, it is the string matching the corresponding parenthesized "
"group.  If a group number is negative or larger than the number of groups "
"defined in the pattern, an :exc:`IndexError` exception is raised. If a group "
"is contained in a part of the pattern that did not match, the corresponding "
"result is ``None``. If a group is contained in a part of the pattern that "
"matched multiple times, the last match is returned. ::"
msgstr ""

msgid ""
">>> m = re.search(r\"\\A(\\w+) (\\w+)\", \"Norwegian Blue, pining for the "
"fjords\")\n"
">>> m.group(0)       # The entire match\n"
"'Norwegian Blue'\n"
">>> m.group(1)       # The first parenthesized subgroup.\n"
"'Norwegian'\n"
">>> m.group(2)       # The second parenthesized subgroup.\n"
"'Blue'\n"
">>> m.group(1, 2)    # Multiple arguments give us a tuple.\n"
"('Norwegian', 'Blue')"
msgstr ""

msgid ""
"If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN* "
"arguments may also be strings identifying groups by their group name.  If a "
"string argument is not used as a group name in the pattern, "
"an :exc:`IndexError` exception is raised."
msgstr ""

msgid "A moderately complicated example::"
msgstr ""

msgid ""
">>> m = re.search(r\"(?P<adjective>\\w+) (?P<animal>\\w+)\", \"killer "
"rabbit\")\n"
">>> m.group('adjective')\n"
"'killer'\n"
">>> m.group('animal')\n"
"'rabbit'"
msgstr ""

msgid "Named groups can also be referred to by their index::"
msgstr ""

msgid ""
">>> m.group(1)\n"
"'killer'\n"
">>> m.group(2)\n"
"'rabbit'"
msgstr ""

msgid "If a group matches multiple times, only the last match is accessible::"
msgstr ""

msgid ""
">>> m = re.search(r\"(..)+\", \"a1b2c3\")  # Matches 3 times.\n"
">>> m.group(1)                         # Returns only the last match.\n"
"'c3'"
msgstr ""

msgid ""
"This is identical to ``m.group(g)``.  This allows easier access to an "
"individual group from a match::"
msgstr ""

msgid ""
">>> m = re.search(r\"(\\w+) (\\w+)\", \"Norwegian Blue, pining for the "
"fjords\")\n"
">>> m[0]       # The entire match\n"
"'Norwegian Blue'\n"
">>> m[1]       # The first parenthesized subgroup.\n"
"'Norwegian'\n"
">>> m[2]       # The second parenthesized subgroup.\n"
"'Blue'"
msgstr ""

msgid "Named groups are supported as well::"
msgstr ""

msgid ""
">>> m = re.search(r\"(?P<adjective>\\w+) (?P<animal>\\w+)\", \"killer "
"rabbit\")\n"
">>> m['adjective']\n"
"'killer'\n"
">>> m['animal']\n"
"'rabbit'"
msgstr ""

msgid ""
"Return a tuple containing all the subgroups of the match, from 1 up to "
"however many groups are in the pattern.  The *default* argument is used for "
"groups that did not participate in the match; it defaults to ``None``."
msgstr ""

msgid "For example::"
msgstr "Sebagai contoh::"

msgid ""
">>> m = re.search(r\"(\\d+)\\.(\\d+)\", \"24.1632\")\n"
">>> m.groups()\n"
"('24', '1632')"
msgstr ""

msgid ""
"If we make the decimal place and everything after it optional, not all "
"groups might participate in the match.  These groups will default to "
"``None`` unless the *default* argument is given::"
msgstr ""

msgid ""
">>> m = re.search(r\"(\\d+)\\.?(\\d+)?\", \"24\")\n"
">>> m.groups()      # Second group defaults to None.\n"
"('24', None)\n"
">>> m.groups('0')   # Now, the second group defaults to '0'.\n"
"('24', '0')"
msgstr ""

msgid ""
"Return a dictionary containing all the *named* subgroups of the match, keyed "
"by the subgroup name.  The *default* argument is used for groups that did "
"not participate in the match; it defaults to ``None``.  For example::"
msgstr ""

msgid ""
">>> m = re.search(r\"(?P<adjective>\\w+) (?P<animal>\\w+)\", \"killer "
"rabbit\")\n"
">>> m.groupdict()\n"
"{'adjective': 'killer', 'animal': 'rabbit'}"
msgstr ""

msgid ""
"Return the indices of the start and end of the substring matched by *group*; "
"*group* defaults to zero (meaning the whole matched substring). Return "
"``-1`` if *group* exists but did not contribute to the match.  For a match "
"object *m*, and a group *g* that did contribute to the match, the substring "
"matched by group *g* (equivalent to ``m.group(g)``) is ::"
msgstr ""

msgid "m.string[m.start(g):m.end(g)]"
msgstr ""

msgid ""
"Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched "
"a null string.  For example, after ``m = re.search('b(c?)', 'cba')``, "
"``m.start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are "
"both 2, and ``m.start(2)`` raises an :exc:`IndexError` exception."
msgstr ""

msgid "An example that will remove *remove_this* from email addresses::"
msgstr ""

msgid ""
">>> email = \"tony@tiremove_thisger.net\"\n"
">>> m = re.search(\"remove_this\", email)\n"
">>> email[:m.start()] + email[m.end():]\n"
"'tony@tiger.net'"
msgstr ""

msgid ""
"For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note "
"that if *group* did not contribute to the match, this is ``(-1, -1)``. "
"*group* defaults to zero, the entire match."
msgstr ""

msgid ""
"The value of *pos* which was passed to the :meth:`~Pattern.search` "
"or :meth:`~Pattern.match` method of a :ref:`regex object <re-objects>`.  "
"This is the index into the string at which the RE engine started looking for "
"a match."
msgstr ""

msgid ""
"The value of *endpos* which was passed to the :meth:`~Pattern.search` "
"or :meth:`~Pattern.match` method of a :ref:`regex object <re-objects>`.  "
"This is the index into the string beyond which the RE engine will not go."
msgstr ""

msgid ""
"The integer index of the last matched capturing group, or ``None`` if no "
"group was matched at all. For example, the expressions ``(a)b``, ``((a)"
"(b))``, and ``((ab))`` will have ``lastindex == 1`` if applied to the string "
"``'ab'``, while the expression ``(a)(b)`` will have ``lastindex == 2``, if "
"applied to the same string."
msgstr ""

msgid ""
"The name of the last matched capturing group, or ``None`` if the group "
"didn't have a name, or if no group was matched at all."
msgstr ""

msgid ""
"The :ref:`regular expression object <re-objects>` "
"whose :meth:`~Pattern.match` or :meth:`~Pattern.search` method produced this "
"match instance."
msgstr ""

msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`."
msgstr ""

msgid ""
"Added support of :func:`copy.copy` and :func:`copy.deepcopy`.  Match objects "
"are considered atomic."
msgstr ""

msgid "Regular expression examples"
msgstr ""

msgid "Checking for a pair"
msgstr ""

msgid ""
"In this example, we'll use the following helper function to display match "
"objects a little more gracefully::"
msgstr ""

msgid ""
"def displaymatch(match):\n"
"    if match is None:\n"
"        return None\n"
"    return '<Match: %r, groups=%r>' % (match.group(), match.groups())"
msgstr ""

msgid ""
"Suppose you are writing a poker program where a player's hand is represented "
"as a 5-character string with each character representing a card, \"a\" for "
"ace, \"k\" for king, \"q\" for queen, \"j\" for jack, \"t\" for 10, and "
"\"2\" through \"9\" representing the card with that value."
msgstr ""

msgid "To see if a given string is a valid hand, one could do the following::"
msgstr ""

msgid ""
">>> valid_hand_re = re.compile(r\"^[a2-9tjqk]{5}$\")\n"
">>> displaymatch(valid_hand_re.search(\"akt5q\"))  # Valid.\n"
"\"<Match: 'akt5q', groups=()>\"\n"
">>> displaymatch(valid_hand_re.search(\"akt5e\"))  # Invalid.\n"
">>> displaymatch(valid_hand_re.search(\"akt\"))    # Invalid.\n"
">>> displaymatch(valid_hand_re.search(\"727ak\"))  # Valid.\n"
"\"<Match: '727ak', groups=()>\""
msgstr ""

msgid ""
"That last hand, ``\"727ak\"``, contained a pair, or two of the same valued "
"cards. To match this with a regular expression, one could use backreferences "
"as such::"
msgstr ""

msgid ""
">>> pair_re = re.compile(r\".*(.).*\\1\")\n"
">>> displaymatch(pair_re.prefixmatch(\"717ak\"))     # Pair of 7s.\n"
"\"<Match: '717', groups=('7',)>\"\n"
">>> displaymatch(pair_re.prefixmatch(\"718ak\"))     # No pairs.\n"
">>> displaymatch(pair_re.prefixmatch(\"354aa\"))     # Pair of aces.\n"
"\"<Match: '354aa', groups=('a',)>\""
msgstr ""

msgid ""
"To find out what card the pair consists of, one could use "
"the :meth:`~Match.group` method of the match object in the following manner::"
msgstr ""

msgid ""
">>> pair_re = re.compile(r\".*(.).*\\1\")\n"
">>> pair_re.prefixmatch(\"717ak\").group(1)\n"
"'7'\n"
"\n"
"# Error because prefixmatch() returns None, which doesn't have a group() "
"method:\n"
">>> pair_re.prefixmatch(\"718ak\").group(1)\n"
"Traceback (most recent call last):\n"
"  File \"<pyshell#23>\", line 1, in <module>\n"
"    pair_re.prefixmatch(\"718ak\").group(1)\n"
"AttributeError: 'NoneType' object has no attribute 'group'\n"
"\n"
">>> pair_re.prefixmatch(\"354aa\").group(1)\n"
"'a'"
msgstr ""

msgid "Simulating scanf()"
msgstr ""

msgid ""
"Python does not currently have an equivalent to :c:func:`!scanf`.  Regular "
"expressions are generally more powerful, though also more verbose, "
"than :c:func:`!scanf` format strings.  The table below offers some more-or-"
"less equivalent mappings between :c:func:`!scanf` format tokens and regular "
"expressions."
msgstr ""

msgid ":c:func:`!scanf` Token"
msgstr ""

msgid "Regular Expression"
msgstr "Ekspresi Reguler"

msgid "``%c``"
msgstr "``%c``"

msgid "``%5c``"
msgstr "``%5c``"

msgid "``.{5}``"
msgstr "``.{5}``"

msgid "``%d``"
msgstr "``%d``"

msgid "``[-+]?\\d+``"
msgstr "``[-+]?\\d+``"

msgid "``%e``, ``%E``, ``%f``, ``%g``"
msgstr "``%e``, ``%E``, ``%f``, ``%g``"

msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``"
msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``"

msgid "``%i``"
msgstr "``%i``"

msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``"
msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``"

msgid "``%o``"
msgstr "``%o``"

msgid "``[-+]?[0-7]+``"
msgstr "``[-+]?[0-7]+``"

msgid "``%s``"
msgstr "``%s``"

msgid "``\\S+``"
msgstr "``\\S+``"

msgid "``%u``"
msgstr "``%u``"

msgid "``\\d+``"
msgstr "``\\d+``"

msgid "``%x``, ``%X``"
msgstr "``%x``, ``%X``"

msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``"
msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``"

msgid "To extract the filename and numbers from a string like:"
msgstr ""

msgid "/usr/sbin/sendmail - 0 errors, 4 warnings"
msgstr ""

msgid "you would use a :c:func:`!scanf` format like:"
msgstr ""

msgid "%s - %d errors, %d warnings"
msgstr ""

msgid "The equivalent regular expression would be:"
msgstr ""

msgid "(\\S+) - (\\d+) errors, (\\d+) warnings"
msgstr ""

msgid "search() vs. prefixmatch()"
msgstr ""

msgid ""
"Python offers different primitive operations based on regular expressions:"
msgstr ""

msgid ""
":func:`re.prefixmatch` checks for a match only at the beginning of the string"
msgstr ""

msgid ""
":func:`re.search` checks for a match anywhere in the string (this is what "
"Perl does by default)"
msgstr ""

msgid ":func:`re.fullmatch` checks for entire string to be a match"
msgstr ""

msgid ""
">>> re.prefixmatch(\"c\", \"abcdef\")  # No match\n"
">>> re.search(\"c\", \"abcdef\")       # Match\n"
"<re.Match object; span=(2, 3), match='c'>\n"
">>> re.fullmatch(\"p.*n\", \"python\") # Match\n"
"<re.Match object; span=(0, 6), match='python'>\n"
">>> re.fullmatch(\"r.*n\", \"python\") # No match"
msgstr ""

msgid ""
"Regular expressions beginning with ``'^'`` can be used with :func:`search` "
"to restrict the match at the beginning of the string::"
msgstr ""

msgid ""
">>> re.prefixmatch(\"c\", \"abcdef\")  # No match\n"
">>> re.search(\"^c\", \"abcdef\")      # No match\n"
">>> re.search(\"^a\", \"abcdef\")      # Match\n"
"<re.Match object; span=(0, 1), match='a'>"
msgstr ""

msgid ""
"Note however that in :const:`MULTILINE` mode :func:`prefixmatch` only "
"matches at the beginning of the string, whereas using :func:`search` with a "
"regular expression beginning with ``'^'`` will match at the beginning of "
"each line. ::"
msgstr ""

msgid ""
">>> re.prefixmatch(\"X\", \"A\\nB\\nX\", re.MULTILINE)  # No match\n"
">>> re.search(\"^X\", \"A\\nB\\nX\", re.MULTILINE)  # Match\n"
"<re.Match object; span=(4, 5), match='X'>"
msgstr ""

msgid "prefixmatch() vs. match()"
msgstr ""

msgid ""
"Why is the :func:`~re.match` function and method discouraged in favor of the "
"longer :func:`~re.prefixmatch` spelling?"
msgstr ""

msgid ""
"Many other languages have gained regex support libraries since regular "
"expressions were added to Python. However in the most popular of those, they "
"use the term *match* in their APIs to mean the unanchored behavior provided "
"in Python by :func:`~re.search`. Thus use of the plain term *match* can be "
"unclear to those used to other languages when reading or writing code and "
"not familiar with the Python API's divergence from what otherwise become the "
"industry norm."
msgstr ""

msgid ""
"Quoting from the Zen Of Python (``python3 -m this``): *\"Explicit is better "
"than implicit\"*. Anyone reading the name :func:`!prefixmatch` is likely to "
"understand the intended semantics. When reading :func:`!match` there remains "
"a seed of doubt about the intended behavior to anyone not already familiar "
"with this old Python gotcha."
msgstr ""

msgid ""
"We **do not** plan to remove the older :func:`!match` name, as it has been "
"used in code for over 30 years. It has been :term:`soft deprecated`: code "
"supporting older versions of Python should continue to use :func:`!match`, "
"while new code should prefer :func:`!prefixmatch`."
msgstr ""

msgid ":func:`!prefixmatch`"
msgstr ""

msgid ":func:`!match`"
msgstr ""

msgid "Making a phonebook"
msgstr ""

msgid ""
":func:`split` splits a string into a list delimited by the passed pattern.  "
"The method is invaluable for converting textual data into data structures "
"that can be easily read and modified by Python as demonstrated in the "
"following example that creates a phonebook."
msgstr ""

msgid ""
"First, here is the input.  Normally it may come from a file, here we are "
"using triple-quoted string syntax"
msgstr ""

msgid ""
">>> text = \"\"\"Ross McFluff: 834.345.1254 155 Elm Street\n"
"...\n"
"... Ronald Heathmore: 892.345.3428 436 Finley Avenue\n"
"... Frank Burger: 925.541.7625 662 South Dogwood Way\n"
"...\n"
"...\n"
"... Heather Albrecht: 548.326.4584 919 Park Place\"\"\""
msgstr ""

msgid ""
"The entries are separated by one or more newlines. Now we convert the string "
"into a list with each nonempty line having its own entry:"
msgstr ""

msgid ""
">>> entries = re.split(\"\\n+\", text)\n"
">>> entries\n"
"['Ross McFluff: 834.345.1254 155 Elm Street',\n"
"'Ronald Heathmore: 892.345.3428 436 Finley Avenue',\n"
"'Frank Burger: 925.541.7625 662 South Dogwood Way',\n"
"'Heather Albrecht: 548.326.4584 919 Park Place']"
msgstr ""

msgid ""
"Finally, split each entry into a list with first name, last name, telephone "
"number, and address.  We use the ``maxsplit`` parameter of :func:`split` "
"because the address has spaces, our splitting pattern, in it:"
msgstr ""

msgid ""
">>> [re.split(\":? \", entry, maxsplit=3) for entry in entries]\n"
"[['Ross', 'McFluff', '834.345.1254', '155 Elm Street'],\n"
"['Ronald', 'Heathmore', '892.345.3428', '436 Finley Avenue'],\n"
"['Frank', 'Burger', '925.541.7625', '662 South Dogwood Way'],\n"
"['Heather', 'Albrecht', '548.326.4584', '919 Park Place']]"
msgstr ""

msgid ""
"The ``:?`` pattern matches the colon after the last name, so that it does "
"not occur in the result list.  With a ``maxsplit`` of ``4``, we could "
"separate the house number from the street name:"
msgstr ""

msgid ""
">>> [re.split(\":? \", entry, maxsplit=4) for entry in entries]\n"
"[['Ross', 'McFluff', '834.345.1254', '155', 'Elm Street'],\n"
"['Ronald', 'Heathmore', '892.345.3428', '436', 'Finley Avenue'],\n"
"['Frank', 'Burger', '925.541.7625', '662', 'South Dogwood Way'],\n"
"['Heather', 'Albrecht', '548.326.4584', '919', 'Park Place']]"
msgstr ""

msgid "Text munging"
msgstr ""

msgid ""
":func:`sub` replaces every occurrence of a pattern with a string or the "
"result of a function.  This example demonstrates using :func:`sub` with a "
"function to \"munge\" text, or randomize the order of all the characters in "
"each word of a sentence except for the first and last characters::"
msgstr ""

msgid ""
">>> def repl(m):\n"
"...     inner_word = list(m.group(2))\n"
"...     random.shuffle(inner_word)\n"
"...     return m.group(1) + \"\".join(inner_word) + m.group(3)\n"
"...\n"
">>> text = \"Professor Abdolmalek, please report your absences promptly.\"\n"
">>> re.sub(r\"(\\w)(\\w+)(\\w)\", repl, text)\n"
"'Poefsrosr Aealmlobdk, pslaee reorpt your abnseces plmrptoy.'\n"
">>> re.sub(r\"(\\w)(\\w+)(\\w)\", repl, text)\n"
"'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.'"
msgstr ""

msgid "Finding all adverbs"
msgstr ""

msgid ""
":func:`findall` matches *all* occurrences of a pattern, not just the first "
"one as :func:`search` does.  For example, if a writer wanted to find all of "
"the adverbs in some text, they might use :func:`findall` in the following "
"manner::"
msgstr ""

msgid ""
">>> text = \"He was carefully disguised but captured quickly by police.\"\n"
">>> re.findall(r\"\\w+ly\\b\", text)\n"
"['carefully', 'quickly']"
msgstr ""

msgid "Finding all adverbs and their positions"
msgstr ""

msgid ""
"If one wants more information about all matches of a pattern than the "
"matched text, :func:`finditer` is useful as it provides :class:`~re.Match` "
"objects instead of strings.  Continuing with the previous example, if a "
"writer wanted to find all of the adverbs *and their positions* in some text, "
"they would use :func:`finditer` in the following manner::"
msgstr ""

msgid ""
">>> text = \"He was carefully disguised but captured quickly by police.\"\n"
">>> for m in re.finditer(r\"\\w+ly\\b\", text):\n"
"...     print('%02d-%02d: %s' % (m.start(), m.end(), m.group(0)))\n"
"07-16: carefully\n"
"40-47: quickly"
msgstr ""

msgid "Raw string notation"
msgstr ""

msgid ""
"Raw string notation (``r\"text\"``) keeps regular expressions sane.  Without "
"it, every backslash (``'\\'``) in a regular expression would have to be "
"prefixed with another one to escape it.  For example, the two following "
"lines of code are functionally identical::"
msgstr ""

msgid ""
">>> re.search(r\"\\W(.)\\1\\W\", \" ff \")\n"
"<re.Match object; span=(0, 4), match=' ff '>\n"
">>> re.search(\"\\\\W(.)\\\\1\\\\W\", \" ff \")\n"
"<re.Match object; span=(0, 4), match=' ff '>"
msgstr ""

msgid ""
"When one wants to match a literal backslash, it must be escaped in the "
"regular expression.  With raw string notation, this means ``r\"\\\\\"``.  "
"Without raw string notation, one must use ``\"\\\\\\\\\"``, making the "
"following lines of code functionally identical::"
msgstr ""

msgid ""
">>> re.search(r\"\\\\\", r\"\\\\\")\n"
"<re.Match object; span=(0, 1), match='\\\\'>\n"
">>> re.search(\"\\\\\\\\\", r\"\\\\\")\n"
"<re.Match object; span=(0, 1), match='\\\\'>"
msgstr ""

msgid "Writing a tokenizer"
msgstr ""

msgid ""
"A `tokenizer or scanner <https://en.wikipedia.org/wiki/Lexical_analysis>`_ "
"analyzes a string to categorize groups of characters.  This is a useful "
"first step in writing a compiler or interpreter."
msgstr ""

msgid ""
"The text categories are specified with regular expressions.  The technique "
"is to combine those into a single master regular expression and to loop over "
"successive matches::"
msgstr ""

msgid ""
"from typing import NamedTuple\n"
"import re\n"
"\n"
"class Token(NamedTuple):\n"
"    type: str\n"
"    value: int | float | str\n"
"    line: int\n"
"    column: int\n"
"\n"
"def tokenize(code):\n"
"    keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'}\n"
"    token_specification = [\n"
"        ('NUMBER',   r'\\d+(\\.\\d*)?'),  # Integer or decimal number\n"
"        ('ASSIGN',   r':='),           # Assignment operator\n"
"        ('END',      r';'),            # Statement terminator\n"
"        ('ID',       r'[A-Za-z]+'),    # Identifiers\n"
"        ('OP',       r'[+\\-*/]'),      # Arithmetic operators\n"
"        ('NEWLINE',  r'\\n'),           # Line endings\n"
"        ('SKIP',     r'[ \\t]+'),       # Skip over spaces and tabs\n"
"        ('MISMATCH', r'.'),            # Any other character\n"
"    ]\n"
"    tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in "
"token_specification)\n"
"    line_num = 1\n"
"    line_start = 0\n"
"    for mo in re.finditer(tok_regex, code):\n"
"        kind = mo.lastgroup\n"
"        value = mo.group()\n"
"        column = mo.start() - line_start\n"
"        if kind == 'NUMBER':\n"
"            value = float(value) if '.' in value else int(value)\n"
"        elif kind == 'ID' and value in keywords:\n"
"            kind = value\n"
"        elif kind == 'NEWLINE':\n"
"            line_start = mo.end()\n"
"            line_num += 1\n"
"            continue\n"
"        elif kind == 'SKIP':\n"
"            continue\n"
"        elif kind == 'MISMATCH':\n"
"            raise RuntimeError(f'{value!r} unexpected on line {line_num}')\n"
"        yield Token(kind, value, line_num, column)\n"
"\n"
"statements = '''\n"
"    IF quantity THEN\n"
"        total := total + price * quantity;\n"
"        tax := price * 0.05;\n"
"    ENDIF;\n"
"'''\n"
"\n"
"for token in tokenize(statements):\n"
"    print(token)"
msgstr ""

msgid "The tokenizer produces the following output::"
msgstr ""

msgid ""
"Token(type='IF', value='IF', line=2, column=4)\n"
"Token(type='ID', value='quantity', line=2, column=7)\n"
"Token(type='THEN', value='THEN', line=2, column=16)\n"
"Token(type='ID', value='total', line=3, column=8)\n"
"Token(type='ASSIGN', value=':=', line=3, column=14)\n"
"Token(type='ID', value='total', line=3, column=17)\n"
"Token(type='OP', value='+', line=3, column=23)\n"
"Token(type='ID', value='price', line=3, column=25)\n"
"Token(type='OP', value='*', line=3, column=31)\n"
"Token(type='ID', value='quantity', line=3, column=33)\n"
"Token(type='END', value=';', line=3, column=41)\n"
"Token(type='ID', value='tax', line=4, column=8)\n"
"Token(type='ASSIGN', value=':=', line=4, column=12)\n"
"Token(type='ID', value='price', line=4, column=15)\n"
"Token(type='OP', value='*', line=4, column=21)\n"
"Token(type='NUMBER', value=0.05, line=4, column=23)\n"
"Token(type='END', value=';', line=4, column=27)\n"
"Token(type='ENDIF', value='ENDIF', line=5, column=4)\n"
"Token(type='END', value=';', line=5, column=9)"
msgstr ""

msgid ""
"Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, "
"2009. The third edition of the book no longer covers Python at all, but the "
"first edition covered writing good regular expression patterns in great "
"detail."
msgstr ""

msgid ". (dot)"
msgstr ""

msgid "in regular expressions"
msgstr ""

msgid "^ (caret)"
msgstr ""

msgid "$ (dollar)"
msgstr ""

msgid "* (asterisk)"
msgstr ""

msgid "+ (plus)"
msgstr ""

msgid "? (question mark)"
msgstr ""

msgid "*?"
msgstr ""

msgid "+?"
msgstr ""

msgid "??"
msgstr ""

msgid "*+"
msgstr ""

msgid "++"
msgstr ""

msgid "?+"
msgstr ""

msgid "{} (curly brackets)"
msgstr ""

msgid "\\ (backslash)"
msgstr ""

msgid "[] (square brackets)"
msgstr ""

msgid "- (minus)"
msgstr ""

msgid "| (vertical bar)"
msgstr ""

msgid "() (parentheses)"
msgstr ""

msgid "(?"
msgstr ""

msgid "(?:"
msgstr ""

msgid "(?>"
msgstr ""

msgid "(?P<"
msgstr ""

msgid "(?P="
msgstr ""

msgid "(?#"
msgstr ""

msgid "(?="
msgstr ""

msgid "(?!"
msgstr ""

msgid "(?<="
msgstr ""

msgid "(?<!"
msgstr ""

msgid "(?("
msgstr ""

msgid "\\A"
msgstr ""

msgid "\\b"
msgstr ""

msgid "\\B"
msgstr ""

msgid "\\d"
msgstr ""

msgid "\\D"
msgstr ""

msgid "\\s"
msgstr ""

msgid "\\S"
msgstr ""

msgid "\\w"
msgstr ""

msgid "\\W"
msgstr ""

msgid "\\z"
msgstr ""

msgid "\\Z"
msgstr ""

msgid "\\a"
msgstr ""

msgid "\\f"
msgstr ""

msgid "\\n"
msgstr ""

msgid "\\r"
msgstr ""

msgid "\\t"
msgstr ""

msgid "\\u"
msgstr ""

msgid "\\U"
msgstr ""

msgid "\\v"
msgstr ""

msgid "\\x"
msgstr ""

msgid "\\\\"
msgstr ""

msgid "# (hash)"
msgstr ""

msgid "\\g"
msgstr ""

msgid "scanf (C function)"
msgstr ""
