chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b4dddbb8-4e6b-4559-b884-887600689dcb | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,044 | supabase-export-v2 | eb3b1472ccd4eb1b | .. index:: single: (?<=; in regular expressions
``(?<=...)``
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... | trusted_official_docs | CPython Docs | .. index:: single: (?<=; in regular expressions
``(?<=...)``
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... | .. index:: single: (?<=; in regular expressions
``(?<=...)``
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... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b638dc2e-8269-46b1-b80f-f5b9c26a2ae2 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,209 | supabase-export-v2 | 97674ae70ab8f648 | 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-'``.
.. index:: single: \g; in regular expressions | trusted_official_docs | CPython Docs | 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-'``.
.. index:: single: \g; in regular expressions | 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-'``.
.. index:: single: \g; in regular expressions | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b6fafab3-9f9a-43b2-9bd2-8fdb25cd6ed1 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,357 | supabase-export-v2 | d4f9e8dae78a0b7a | >>> pair_re = re.compile(r".*(.).*\1") >>> pair_re.prefixmatch("717ak").group(1) '7'
# Error because prefixmatch() returns None, which doesn't have a group() method:
>>> pair_re.prefixmatch("718ak").group(1)
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
pair_re.prefixmatch("718ak").gro... | trusted_official_docs | CPython Docs | >>> pair_re = re.compile(r".*(.).*\1") >>> pair_re.prefixmatch("717ak").group(1) '7'
# Error because prefixmatch() returns None, which doesn't have a group() method:
>>> pair_re.prefixmatch("718ak").group(1)
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
pair_re.prefixmatch("718ak").gro... | >>> pair_re = re.compile(r".*(.).*\1") >>> pair_re.prefixmatch("717ak").group(1) '7'
# Error because prefixmatch() returns None, which doesn't have a group() method:
>>> pair_re.prefixmatch("718ak").group(1)
Traceback (most recent call last):
File "<pyshell#23>", line 1, in <module>
pair_re.prefixmatch("718ak").gro... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
b8dde164-e1c7-4c9b-92c3-095104960f4a | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,158 | supabase-export-v2 | 762bfae0facf5648 | result = re.search(pattern, string)
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. | trusted_official_docs | CPython Docs | result = re.search(pattern, string)
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. | result = re.search(pattern, string)
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
bb7fc510-fcee-47c8-872f-324145e919de | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 50,955 | supabase-export-v2 | f085b6344b258d4e | 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.
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'`... | trusted_official_docs | CPython Docs | 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.
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'`... | 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.
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'`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c0fc1794-5a60-4a9f-bc58-b08c5d50fe0e | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,291 | supabase-export-v2 | acc72a35f32d9654 | Match objects -------------
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:: | trusted_official_docs | CPython Docs | Match objects -------------
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:: | Match objects -------------
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:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c300cc62-60d1-4560-a24e-4baf63c248e9 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,005 | supabase-export-v2 | b89045fec4bb1714 | character except ``'5'``, and ``[^^]`` will match any character except ``'^'``. ``^`` has no special meaning if it's not the first character in the set.
* 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
``[]()[{}]`` wil... | trusted_official_docs | CPython Docs | character except ``'5'``, and ``[^^]`` will match any character except ``'^'``. ``^`` has no special meaning if it's not the first character in the set.
* 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
``[]()[{}]`` wil... | character except ``'5'``, and ``[^^]`` will match any character except ``'^'``. ``^`` has no special meaning if it's not the first character in the set.
* 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
``[]()[{}]`` wil... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c39c8d70-5136-4d41-a5d9-8401fc2675d6 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,164 | supabase-export-v2 | 002fa9dcc299cf52 | 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).
.. function:: prefixmatch(pattern, string, flags=0) | trusted_official_docs | CPython Docs | 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).
.. function:: prefixmatch(pattern, string, flags=0) | 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).
.. function:: prefixmatch(pattern, string, flags=0) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c5242ae5-ea5e-4247-9a05-39bc22dca0ed | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,078 | supabase-export-v2 | cb3153baf5ce83c2 | (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.
Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used. | trusted_official_docs | CPython Docs | (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.
Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used. | (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.
Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c65e9cf2-1328-401c-972a-93a86b797236 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,419 | supabase-export-v2 | 4643474d7b3e5979 | 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.
The text categories are specified with regular expressions. The technique is
to combine those into a single master regular ex... | trusted_official_docs | CPython Docs | 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.
The text categories are specified with regular expressions. The technique is
to combine those into a single master regular ex... | 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.
The text categories are specified with regular expressions. The technique is
to combine those into a single master regular ex... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c77e60cb-7a1a-4184-aab1-3656d8418de4 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,022 | supabase-export-v2 | 74eea1e3c1ad0b21 | 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.
``(?aiLmsux-imsx:...)``
(Zero or more letters from the set
``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'``,
optionally followed by ``'-'`` foll... | trusted_official_docs | CPython Docs | 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.
``(?aiLmsux-imsx:...)``
(Zero or more letters from the set
``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'``,
optionally followed by ``'-'`` foll... | 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.
``(?aiLmsux-imsx:...)``
(Zero or more letters from the set
``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'``,
optionally followed by ``'-'`` foll... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c8dc0980-02ea-4880-94a3-7e0fd57dbbdf | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,226 | supabase-export-v2 | 206561e5da7c1793 | >>> operators = ['+', '-', '*', '/', '**'] >>> print('|'.join(map(re.escape, sorted(operators, reverse=True)))) /|\-|\+|\*\*|\*
This function must not be used for the replacement string in :func:`sub`
and :func:`subn`, only backslashes should be escaped. For example:: | trusted_official_docs | CPython Docs | >>> operators = ['+', '-', '*', '/', '**'] >>> print('|'.join(map(re.escape, sorted(operators, reverse=True)))) /|\-|\+|\*\*|\*
This function must not be used for the replacement string in :func:`sub`
and :func:`subn`, only backslashes should be escaped. For example:: | >>> operators = ['+', '-', '*', '/', '**'] >>> print('|'.join(map(re.escape, sorted(operators, reverse=True)))) /|\-|\+|\*\*|\*
This function must not be used for the replacement string in :func:`sub`
and :func:`subn`, only backslashes should be escaped. For example:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
c9b31e1a-6fdf-4145-b38d-8afe25d46487 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,262 | supabase-export-v2 | daa3c0fd59ec6228 | If you want to locate a match anywhere in *string*, use :meth:`~Pattern.search` instead (see also :ref:`search-vs-match`).
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. | trusted_official_docs | CPython Docs | If you want to locate a match anywhere in *string*, use :meth:`~Pattern.search` instead (see also :ref:`search-vs-match`).
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. | If you want to locate a match anywhere in *string*, use :meth:`~Pattern.search` instead (see also :ref:`search-vs-match`).
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
caaa5981-503a-435e-8da6-5c9346743ecb | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 50,990 | supabase-export-v2 | baf0b24540d03a87 | 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.
``{m,n}+``
Causes the resulting RE to match from *m* to *n* repetitions of the
preceding RE, attempting to match as many repetitions as p... | trusted_official_docs | CPython Docs | 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.
``{m,n}+``
Causes the resulting RE to match from *m* to *n* repetitions of the
preceding RE, attempting to match as many repetitions as p... | 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.
``{m,n}+``
Causes the resulting RE to match from *m* to *n* repetitions of the
preceding RE, attempting to match as many repetitions as p... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cae66416-8544-4ce0-b683-c58c65f1d25d | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,025 | supabase-export-v2 | 9cd400f34fd7c35a | (The flags are described in :ref:`contents-of-module-re`.)
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 pa... | trusted_official_docs | CPython Docs | (The flags are described in :ref:`contents-of-module-re`.)
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 pa... | (The flags are described in :ref:`contents-of-module-re`.)
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 pa... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cd7d00b9-8b0c-4c3e-be7d-4141fed01fe2 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,088 | supabase-export-v2 | 827a8815d68ca81a | .. index:: single: \W; in regular expressions
``\W``
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``. | trusted_official_docs | CPython Docs | .. index:: single: \W; in regular expressions
``\W``
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``. | .. index:: single: \W; in regular expressions
``\W``
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``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ce4adbc5-a7bd-4620-b48c-1462db62818d | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,254 | supabase-export-v2 | 85d4fa528886b8d4 | 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.
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`... | trusted_official_docs | CPython Docs | 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.
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`... | 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.
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`... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cfd3b3a2-1641-4e9e-aafa-1d1283917175 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,152 | supabase-export-v2 | eae18f3cb361771b | .. function:: compile(pattern, flags=0)
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. | trusted_official_docs | CPython Docs | .. function:: compile(pattern, flags=0)
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. | .. function:: compile(pattern, flags=0)
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
cfeef82b-abca-42a4-9613-92b31eb85214 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,091 | supabase-export-v2 | f2891ddb35d01611 | If the :py:const:`~re.LOCALE` flag is used, matches characters which are neither alphanumeric in the current locale nor the underscore.
.. index:: single: \z; in regular expressions
single: \Z; in regular expressions | trusted_official_docs | CPython Docs | If the :py:const:`~re.LOCALE` flag is used, matches characters which are neither alphanumeric in the current locale nor the underscore.
.. index:: single: \z; in regular expressions
single: \Z; in regular expressions | If the :py:const:`~re.LOCALE` flag is used, matches characters which are neither alphanumeric in the current locale nor the underscore.
.. index:: single: \z; in regular expressions
single: \Z; in regular expressions | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d00106be-ffac-4f58-b0b8-90e086a53a92 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,256 | supabase-export-v2 | 37824929776d5e55 | = re.compile("d") >>> pattern.search("dog") # Match at index 0 <re.Match object; span=(0, 1), match='d'> >>> pattern.search("dog", 1) # No match; search doesn't include the "d"
.. method:: Pattern.prefixmatch(string[, pos[, endpos]]) | trusted_official_docs | CPython Docs | = re.compile("d") >>> pattern.search("dog") # Match at index 0 <re.Match object; span=(0, 1), match='d'> >>> pattern.search("dog", 1) # No match; search doesn't include the "d"
.. method:: Pattern.prefixmatch(string[, pos[, endpos]]) | = re.compile("d") >>> pattern.search("dog") # Match at index 0 <re.Match object; span=(0, 1), match='d'> >>> pattern.search("dog", 1) # No match; search doesn't include the "d"
.. method:: Pattern.prefixmatch(string[, pos[, endpos]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d28dfacb-4055-4381-80e2-7c6a7fc48e69 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,353 | supabase-export-v2 | b678e4fa8de28be1 | valid_hand_re = re.compile(r"^[a2-9tjqk]{5}$") >>> displaymatch(valid_hand_re.search("akt5q")) # Valid. "<Match: 'akt5q', groups=()>" >>> displaymatch(valid_hand_re.search("akt5e")) # Invalid. >>> displaymatch(valid_hand_re.search("akt")) # Invalid. >>> displaymatch(valid_hand_re.search("727ak")) # Valid. "<Match: '727... | trusted_official_docs | CPython Docs | valid_hand_re = re.compile(r"^[a2-9tjqk]{5}$") >>> displaymatch(valid_hand_re.search("akt5q")) # Valid. "<Match: 'akt5q', groups=()>" >>> displaymatch(valid_hand_re.search("akt5e")) # Invalid. >>> displaymatch(valid_hand_re.search("akt")) # Invalid. >>> displaymatch(valid_hand_re.search("727ak")) # Valid. "<Match: '727... | valid_hand_re = re.compile(r"^[a2-9tjqk]{5}$") >>> displaymatch(valid_hand_re.search("akt5q")) # Valid. "<Match: 'akt5q', groups=()>" >>> displaymatch(valid_hand_re.search("akt5e")) # Invalid. >>> displaymatch(valid_hand_re.search("akt")) # Invalid. >>> displaymatch(valid_hand_re.search("727ak")) # Valid. "<Match: '727... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d2a9ca09-0ffc-49ec-93fa-280061348fbb | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,011 | supabase-export-v2 | 5f339ec064ad7762 | .. index:: single: | (vertical bar); in regular expressions
``|``
``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... | trusted_official_docs | CPython Docs | .. index:: single: | (vertical bar); in regular expressions
``|``
``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... | .. index:: single: | (vertical bar); in regular expressions
``|``
``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... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d334919b-44ba-496f-81c4-56f30e0acc2a | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,133 | supabase-export-v2 | f8e70aa7d0191dde | of the string, and ``'$'`` only at the end of the string and immediately before the newline (if any) at the end of the string.
Corresponds to the inline flag ``(?m)``. | trusted_official_docs | CPython Docs | of the string, and ``'$'`` only at the end of the string and immediately before the newline (if any) at the end of the string.
Corresponds to the inline flag ``(?m)``. | of the string, and ``'$'`` only at the end of the string and immediately before the newline (if any) at the end of the string.
Corresponds to the inline flag ``(?m)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d39db928-38e6-4110-ae2e-19474e193888 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,186 | supabase-export-v2 | fda1477f6a4a7b70 | .. code:: pycon
>>> re.split(r'\b', 'Words, words, words.')
['', 'Words', ', ', 'words', ', ', 'words', '.']
>>> re.split(r'\W*', '...words...')
['', '', 'w', 'o', 'r', 'd', 's', '', '']
>>> re.split(r'(\W*)', '...words...')
['', '...', '', '', 'w', '', 'o', '', 'r', '', 'd', '', 's', '...', '', '', ''] | trusted_official_docs | CPython Docs | .. code:: pycon
>>> re.split(r'\b', 'Words, words, words.')
['', 'Words', ', ', 'words', ', ', 'words', '.']
>>> re.split(r'\W*', '...words...')
['', '', 'w', 'o', 'r', 'd', 's', '', '']
>>> re.split(r'(\W*)', '...words...')
['', '...', '', '', 'w', '', 'o', '', 'r', '', 'd', '', 's', '...', '', '', ''] | .. code:: pycon
>>> re.split(r'\b', 'Words, words, words.')
['', 'Words', ', ', 'words', ', ', 'words', '.']
>>> re.split(r'\W*', '...words...')
['', '', 'w', 'o', 'r', 'd', 's', '', '']
>>> re.split(r'(\W*)', '...words...')
['', '...', '', '', 'w', '', 'o', '', 'r', '', 'd', '', 's', '...', '', '', ''] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d4236689-43e6-43de-9005-f76d10958434 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,325 | supabase-export-v2 | d132968132f091d9 | .. method:: Match.start([group]) Match.end([group])
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 contri... | trusted_official_docs | CPython Docs | .. method:: Match.start([group]) Match.end([group])
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 contri... | .. method:: Match.start([group]) Match.end([group])
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 contri... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d64545c9-88d2-40d6-a31e-83c8a1141c19 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,390 | supabase-export-v2 | dcf7254772fc8289 | Making a phonebook ^^^^^^^^^^^^^^^^^^
: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. | trusted_official_docs | CPython Docs | Making a phonebook ^^^^^^^^^^^^^^^^^^
: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. | Making a phonebook ^^^^^^^^^^^^^^^^^^
: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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d842ef04-d334-45bc-aa5a-ac3f83369fb8 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,016 | supabase-export-v2 | f82788d5d53cc3e8 | 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.
``(?aiLmsux)``
(One or more letters from the set
``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'``.)
The group matches the empty string;
... | trusted_official_docs | CPython Docs | 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.
``(?aiLmsux)``
(One or more letters from the set
``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'``.)
The group matches the empty string;
... | 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.
``(?aiLmsux)``
(One or more letters from the set
``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'``.)
The group matches the empty string;
... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d8ae7d3c-bc12-412f-bd27-7e3badff3666 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,204 | supabase-export-v2 | ad6e46d14c6449b4 | >>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', ... r'static PyObject*\npy_\1(void)\n{', ... 'def myfunc():') 'static PyObject*\npy_myfunc(void)\n{'
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
th... | trusted_official_docs | CPython Docs | >>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', ... r'static PyObject*\npy_\1(void)\n{', ... 'def myfunc():') 'static PyObject*\npy_myfunc(void)\n{'
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
th... | >>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', ... r'static PyObject*\npy_\1(void)\n{', ... 'def myfunc():') 'static PyObject*\npy_myfunc(void)\n{'
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
th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dbae08c4-30f9-4369-a17e-341569d89eb7 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,143 | supabase-export-v2 | 5b68c487a282ea1b | 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.
See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead. | trusted_official_docs | CPython Docs | 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.
See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead. | 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.
See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dbb307c9-72c6-4654-a786-34ed798d464a | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,234 | supabase-export-v2 | 985fdb9c2c8f760d | .. exception:: PatternError(msg, pattern=None, pos=None)
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... | trusted_official_docs | CPython Docs | .. exception:: PatternError(msg, pattern=None, pos=None)
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... | .. exception:: PatternError(msg, pattern=None, pos=None)
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... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dc2a42ae-2e46-4675-a05e-4239c14f0101 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,170 | supabase-export-v2 | df3a08398d8eac51 | 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).
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 version... | trusted_official_docs | CPython Docs | 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).
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 version... | 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).
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 version... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dca50605-eeb2-4e50-a000-e3c24ecbe5e3 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,302 | supabase-export-v2 | e6f70e85216634d3 | The first parenthesized subgroup. 'Norwegian' >>> m.group(2) # The second parenthesized subgroup. 'Blue' >>> m.group(1, 2) # Multiple arguments give us a tuple. ('Norwegian', 'Blue')
If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN*
arguments may also be strings identifying groups by their grou... | trusted_official_docs | CPython Docs | The first parenthesized subgroup. 'Norwegian' >>> m.group(2) # The second parenthesized subgroup. 'Blue' >>> m.group(1, 2) # Multiple arguments give us a tuple. ('Norwegian', 'Blue')
If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN*
arguments may also be strings identifying groups by their grou... | The first parenthesized subgroup. 'Norwegian' >>> m.group(2) # The second parenthesized subgroup. 'Blue' >>> m.group(1, 2) # Multiple arguments give us a tuple. ('Norwegian', 'Blue')
If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN*
arguments may also be strings identifying groups by their grou... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
df08c9b3-790b-4261-91e9-7f8068bb4c42 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 50,966 | supabase-export-v2 | c5968176f12a5961 | like ``'|'`` or ``'('``, are special. Special characters either stand for classes of ordinary characters, or affect how the regular expressions around them are interpreted.
Repetition operators or quantifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be
directly nested. This avoids ambiguity with the non-greedy modi... | trusted_official_docs | CPython Docs | like ``'|'`` or ``'('``, are special. Special characters either stand for classes of ordinary characters, or affect how the regular expressions around them are interpreted.
Repetition operators or quantifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be
directly nested. This avoids ambiguity with the non-greedy modi... | like ``'|'`` or ``'('``, are special. Special characters either stand for classes of ordinary characters, or affect how the regular expressions around them are interpreted.
Repetition operators or quantifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be
directly nested. This avoids ambiguity with the non-greedy modi... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
dfa38d74-5b9e-4390-ae7f-73a9f184a1e7 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,021 | supabase-export-v2 | e70b47e02524977e | .. index:: single: (?:; in regular expressions
``(?:...)``
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. | trusted_official_docs | CPython Docs | .. index:: single: (?:; in regular expressions
``(?:...)``
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. | .. index:: single: (?:; in regular expressions
``(?:...)``
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e013c2ee-b2a6-4cf4-900e-aad2932cd80e | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,267 | supabase-export-v2 | d1190e2d83906a06 | .. method:: Pattern.fullmatch(string[, pos[, endpos]])
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. | trusted_official_docs | CPython Docs | .. method:: Pattern.fullmatch(string[, pos[, endpos]])
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. | .. method:: Pattern.fullmatch(string[, pos[, endpos]])
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e01dbf13-10d3-49fc-9d85-7076012ec23a | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,205 | supabase-export-v2 | 456e66028c72161b | 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::
>>> def dashrepl(matchobj):
... if matchobj.group(0) == '-': return ' '
... else: return '-'
... >>> re.sub('-{1,2}', dashrepl, 'pro--... | trusted_official_docs | CPython Docs | 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::
>>> def dashrepl(matchobj):
... if matchobj.group(0) == '-': return ' '
... else: return '-'
... >>> re.sub('-{1,2}', dashrepl, 'pro--... | 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::
>>> def dashrepl(matchobj):
... if matchobj.group(0) == '-': return ' '
... else: return '-'
... >>> re.sub('-{1,2}', dashrepl, 'pro--... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e0998adf-81c1-4d95-ba26-77f3181e1efe | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,331 | supabase-export-v2 | fc668d4ac90c1ce5 | .. method:: Match.span([group])
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. | trusted_official_docs | CPython Docs | .. method:: Match.span([group])
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. | .. method:: Match.span([group])
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e1854adf-2cc0-4b40-bfb0-15166587f688 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,261 | supabase-export-v2 | 1f2712091e647719 | is not at the start of "dog". >>> pattern.prefixmatch("dog", 1) # Match as "o" is the 2nd character of "dog". <re.Match object; span=(1, 2), match='o'>
If you want to locate a match anywhere in *string*, use
:meth:`~Pattern.search` instead (see also :ref:`search-vs-match`). | trusted_official_docs | CPython Docs | is not at the start of "dog". >>> pattern.prefixmatch("dog", 1) # Match as "o" is the 2nd character of "dog". <re.Match object; span=(1, 2), match='o'>
If you want to locate a match anywhere in *string*, use
:meth:`~Pattern.search` instead (see also :ref:`search-vs-match`). | is not at the start of "dog". >>> pattern.prefixmatch("dog", 1) # Match as "o" is the 2nd character of "dog". <re.Match object; span=(1, 2), match='o'>
If you want to locate a match anywhere in *string*, use
:meth:`~Pattern.search` instead (see also :ref:`search-vs-match`). | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e29ef618-3a1f-421f-8b08-4642d6799621 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,396 | supabase-export-v2 | 7247a1a86d7ab7bf | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> entries = re.split("\n+", text)
>>> entries
['Ross McFluff: 834.345.1254 155 Elm Street',
'Ronald Heathmore: 892.345.3428 436 Finley Avenue',
'Frank Burger: 925.541.7625 662 South Dogwood Way',
'Heather Albrecht: 548.326.4584 919 Park Place'] | trusted_official_docs | CPython Docs | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> entries = re.split("\n+", text)
>>> entries
['Ross McFluff: 834.345.1254 155 Elm Street',
'Ronald Heathmore: 892.345.3428 436 Finley Avenue',
'Frank Burger: 925.541.7625 662 South Dogwood Way',
'Heather Albrecht: 548.326.4584 919 Park Place'] | .. doctest:: :options: +NORMALIZE_WHITESPACE
>>> entries = re.split("\n+", text)
>>> entries
['Ross McFluff: 834.345.1254 155 Elm Street',
'Ronald Heathmore: 892.345.3428 436 Finley Avenue',
'Frank Burger: 925.541.7625 662 South Dogwood Way',
'Heather Albrecht: 548.326.4584 919 Park Place'] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e3fbdd4a-fdd6-46b8-924b-234bb43a472c | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,222 | supabase-export-v2 | a91eb45c75ece110 | .. function:: escape(pattern)
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:: | trusted_official_docs | CPython Docs | .. function:: escape(pattern)
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:: | .. function:: escape(pattern)
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:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e5448258-3569-4e3d-bbab-a200bf9c4fc6 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,051 | supabase-export-v2 | 9b3ade3b66daf0c5 | 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.
.. _re-conditional-expression:
.. index:: single: (?(; in regular expressions | trusted_official_docs | CPython Docs | 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.
.. _re-conditional-expression:
.. index:: single: (?(; in regular expressions | 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.
.. _re-conditional-expression:
.. index:: single: (?(; in regular expressions | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e7106e22-3818-4adf-9ce8-5ed15b915d29 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,101 | supabase-export-v2 | 26c9b0af6195598a | 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.
.. versionchanged:: 3.3
The ``'\u'`` and ``'\U'`` escape sequences have been added. | trusted_official_docs | CPython Docs | 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.
.. versionchanged:: 3.3
The ``'\u'`` and ``'\U'`` escape sequences have been added. | 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.
.. versionchanged:: 3.3
The ``'\u'`` and ``'\U'`` escape sequences have been added. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e87797a3-0373-4d02-8b1a-afa0c0df8b8c | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,136 | supabase-export-v2 | ade15ddeb015a9c9 | 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::
def myfunc(pattern, text, flag=re.NOFLAG):
return re.search(pattern, text, flag) | trusted_official_docs | CPython Docs | 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::
def myfunc(pattern, text, flag=re.NOFLAG):
return re.search(pattern, text, flag) | 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::
def myfunc(pattern, text, flag=re.NOFLAG):
return re.search(pattern, text, flag) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e95746f4-b9c2-4f07-9fdf-173f0491fe99 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,165 | supabase-export-v2 | 9c9688494a868a7e | .. function:: prefixmatch(pattern, string, flags=0)
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. | trusted_official_docs | CPython Docs | .. function:: prefixmatch(pattern, string, flags=0)
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. | .. function:: prefixmatch(pattern, string, flags=0)
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
e974637b-4fbe-4100-94ac-4a8aeb11a28b | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,269 | supabase-export-v2 | 581499af53e8400f | The optional *pos* and *endpos* parameters have the same meaning as for the :meth:`~Pattern.search` method. ::
>>> pattern = re.compile("o[gh]")
>>> pattern.fullmatch("dog") # No match as "o" is not at the start of "dog". >>> pattern.fullmatch("ogre") # No match as not the full string matches. >>> pattern.fullmatch("d... | trusted_official_docs | CPython Docs | The optional *pos* and *endpos* parameters have the same meaning as for the :meth:`~Pattern.search` method. ::
>>> pattern = re.compile("o[gh]")
>>> pattern.fullmatch("dog") # No match as "o" is not at the start of "dog". >>> pattern.fullmatch("ogre") # No match as not the full string matches. >>> pattern.fullmatch("d... | The optional *pos* and *endpos* parameters have the same meaning as for the :meth:`~Pattern.search` method. ::
>>> pattern = re.compile("o[gh]")
>>> pattern.fullmatch("dog") # No match as "o" is not at the start of "dog". >>> pattern.fullmatch("ogre") # No match as not the full string matches. >>> pattern.fullmatch("d... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ec35df0a-e842-4f91-ac04-92b8a6ea2e12 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,405 | supabase-export-v2 | 9df107f8cbe1fbfb | 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::
>>> def repl(m):
... inner_word = list(m.group(2))
... random.shuffle(inner_word)
... return m.group(1) + "".join(inner_word) + m.group(3)
... >>> text = "Professor Abdolmalek... | trusted_official_docs | CPython Docs | 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::
>>> def repl(m):
... inner_word = list(m.group(2))
... random.shuffle(inner_word)
... return m.group(1) + "".join(inner_word) + m.group(3)
... >>> text = "Professor Abdolmalek... | 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::
>>> def repl(m):
... inner_word = list(m.group(2))
... random.shuffle(inner_word)
... return m.group(1) + "".join(inner_word) + m.group(3)
... >>> text = "Professor Abdolmalek... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ecf7d1ce-507c-43c4-b09c-9dd96dd1cea4 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,014 | supabase-export-v2 | eb78fa6bd882c2a2 | ``\number`` special sequence, described below. To match the literals ``'('`` or ``')'``, use ``\(`` or ``\)``, or enclose them inside a character class: ``[(]``, ``[)]``.
.. index:: single: (?; in regular expressions | trusted_official_docs | CPython Docs | ``\number`` special sequence, described below. To match the literals ``'('`` or ``')'``, use ``\(`` or ``\)``, or enclose them inside a character class: ``[(]``, ``[)]``.
.. index:: single: (?; in regular expressions | ``\number`` special sequence, described below. To match the literals ``'('`` or ``')'``, use ``\(`` or ``\)``, or enclose them inside a character class: ``[(]``, ``[)]``.
.. index:: single: (?; in regular expressions | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ed048d02-6b09-46d4-9a00-b3ee4826a51c | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,277 | supabase-export-v2 | f2807e8ba44d3b10 | 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`.
.. method:: Pattern.sub(repl, string, count=0) | trusted_official_docs | CPython Docs | 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`.
.. method:: Pattern.sub(repl, string, count=0) | 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`.
.. method:: Pattern.sub(repl, string, count=0) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee058fef-3973-4e25-bc38-e6dc38e83d4d | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,215 | supabase-export-v2 | d989ee1e30f80061 | .. versionchanged:: 3.6 Unknown escapes in *pattern* consisting of ``'\'`` and an ASCII letter now are errors.
.. versionchanged:: 3.7
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
now are errors. An empty match can occur immediately after a non-empty match. | trusted_official_docs | CPython Docs | .. versionchanged:: 3.6 Unknown escapes in *pattern* consisting of ``'\'`` and an ASCII letter now are errors.
.. versionchanged:: 3.7
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
now are errors. An empty match can occur immediately after a non-empty match. | .. versionchanged:: 3.6 Unknown escapes in *pattern* consisting of ``'\'`` and an ASCII letter now are errors.
.. versionchanged:: 3.7
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
now are errors. An empty match can occur immediately after a non-empty match. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ee3d8615-b090-461b-b5a2-2e446d3073e2 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,337 | supabase-export-v2 | da1bd77ac3a4e3ca | .. attribute:: Match.lastindex
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 =... | trusted_official_docs | CPython Docs | .. attribute:: Match.lastindex
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 =... | .. attribute:: Match.lastindex
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 =... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f010e347-a72c-486c-8d60-ab7204100578 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,106 | supabase-export-v2 | 482cf78c8b6958da | Module contents ---------------
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. | trusted_official_docs | CPython Docs | Module contents ---------------
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. | Module contents ---------------
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f0e3fe11-8a3e-4d06-9ed0-9600e3a7fc63 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,188 | supabase-export-v2 | 6e5d6c7414c1b049 | 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).
.. versionchanged:: 3.1
Added the optional flags argument. | trusted_official_docs | CPython Docs | 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).
.. versionchanged:: 3.1
Added the optional flags argument. | 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).
.. versionchanged:: 3.1
Added the optional flags argument. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f19cc23a-7585-4c50-b7bd-cf3cfa74c0d4 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,312 | supabase-export-v2 | 5b4bae623070e573 | fjords") >>> m[0] # The entire match 'Norwegian Blue' >>> m[1] # The first parenthesized subgroup. 'Norwegian' >>> m[2] # The second parenthesized subgroup. 'Blue'
Named groups are supported as well:: | trusted_official_docs | CPython Docs | fjords") >>> m[0] # The entire match 'Norwegian Blue' >>> m[1] # The first parenthesized subgroup. 'Norwegian' >>> m[2] # The second parenthesized subgroup. 'Blue'
Named groups are supported as well:: | fjords") >>> m[0] # The entire match 'Norwegian Blue' >>> m[1] # The first parenthesized subgroup. 'Norwegian' >>> m[2] # The second parenthesized subgroup. 'Blue'
Named groups are supported as well:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f26a5d53-2fc3-4d6f-b3e7-41c627a270c5 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,385 | supabase-export-v2 | 757bd13d64814ed4 | 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.
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 ... | trusted_official_docs | CPython Docs | 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.
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 ... | 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.
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 ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f27a8e15-7166-4753-8e47-79a82a1bebd3 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,253 | supabase-export-v2 | 974d1ccb5cbbe764 | 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.
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 ... | trusted_official_docs | CPython Docs | 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.
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 ... | 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.
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 ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f3020a84-c5a5-4411-87db-27c10168a870 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,113 | supabase-export-v2 | 4302423a932e548a | .. data:: A ASCII
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. | trusted_official_docs | CPython Docs | .. data:: A ASCII
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. | .. data:: A ASCII
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f4d74e8f-04d1-49d0-9aa3-f4b2fdf94949 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,085 | supabase-export-v2 | cbc1894705af7b40 | ``\w`` For Unicode (str) patterns: Matches Unicode word characters; this includes all Unicode alphanumeric characters (as defined by :py:meth:`str.isalnum`), as well as the underscore (``_``).
Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used. | trusted_official_docs | CPython Docs | ``\w`` For Unicode (str) patterns: Matches Unicode word characters; this includes all Unicode alphanumeric characters (as defined by :py:meth:`str.isalnum`), as well as the underscore (``_``).
Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used. | ``\w`` For Unicode (str) patterns: Matches Unicode word characters; this includes all Unicode alphanumeric characters (as defined by :py:meth:`str.isalnum`), as well as the underscore (``_``).
Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f6d86d80-c9b3-4fc7-8061-a013c87e2885 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,275 | supabase-export-v2 | 3ca1d3b757e4df16 | 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`.
.. method:: Pattern.finditer(string[, pos[, endpos]]) | trusted_official_docs | CPython Docs | 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`.
.. method:: Pattern.finditer(string[, pos[, endpos]]) | 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`.
.. method:: Pattern.finditer(string[, pos[, endpos]]) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f7173421-25c6-49c9-b005-57a4cfac4a4c | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,308 | supabase-export-v2 | a54bd794140bdc17 | If a group matches multiple times, only the last match is accessible::
>>> m = re.search(r"(..)+", "a1b2c3") # Matches 3 times. >>> m.group(1) # Returns only the last match. 'c3' | trusted_official_docs | CPython Docs | If a group matches multiple times, only the last match is accessible::
>>> m = re.search(r"(..)+", "a1b2c3") # Matches 3 times. >>> m.group(1) # Returns only the last match. 'c3' | If a group matches multiple times, only the last match is accessible::
>>> m = re.search(r"(..)+", "a1b2c3") # Matches 3 times. >>> m.group(1) # Returns only the last match. 'c3' | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f795380e-c4e3-44aa-8c60-1d655740e6ed | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,208 | supabase-export-v2 | b05409b5ead250b7 | 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.
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--... | trusted_official_docs | CPython Docs | 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.
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--... | 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.
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--... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f861241f-3938-48e6-98de-b79854e4da77 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,179 | supabase-export-v2 | 3812cb350d3336c2 | .. function:: split(pattern, string, maxsplit=0, flags=0)
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 rema... | trusted_official_docs | CPython Docs | .. function:: split(pattern, string, maxsplit=0, flags=0)
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 rema... | .. function:: split(pattern, string, maxsplit=0, flags=0)
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 rema... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f8a661f5-5202-492f-86c6-621a65710bf0 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,193 | supabase-export-v2 | 0d013d160a3a0926 | 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.
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 ... | trusted_official_docs | CPython Docs | 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.
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 ... | 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.
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 ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f8bb63c3-93a7-4340-ab7c-17c69cec1b59 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,322 | supabase-export-v2 | f155f9c45fdaf36c | .. method:: Match.groupdict(default=None)
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:: | trusted_official_docs | CPython Docs | .. method:: Match.groupdict(default=None)
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:: | .. method:: Match.groupdict(default=None)
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:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f9bb0707-2e23-45e2-86aa-89ede6aaa61c | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,114 | supabase-export-v2 | ae9f6bd4af8e00ca | ``\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.
Corresponds to the inline flag ``(?a)``. | trusted_official_docs | CPython Docs | ``\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.
Corresponds to the inline flag ``(?a)``. | ``\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.
Corresponds to the inline flag ``(?a)``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fad075c3-f78c-4b66-a8d1-0c953091ed83 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,407 | supabase-export-v2 | bf702dbc4fb3a796 | Finding all adverbs ^^^^^^^^^^^^^^^^^^^
: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:: | trusted_official_docs | CPython Docs | Finding all adverbs ^^^^^^^^^^^^^^^^^^^
: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:: | Finding all adverbs ^^^^^^^^^^^^^^^^^^^
: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:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fafb7e6a-521c-404d-bc80-429c081b8be7 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,099 | supabase-export-v2 | 6c21d7c15490a693 | (Note that ``\b`` is used to represent word boundaries, and means "backspace" only inside character classes.)
``'\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 er... | trusted_official_docs | CPython Docs | (Note that ``\b`` is used to represent word boundaries, and means "backspace" only inside character classes.)
``'\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 er... | (Note that ``\b`` is used to represent word boundaries, and means "backspace" only inside character classes.)
``'\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 er... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fb403db6-080c-4657-a251-8067df06a8e6 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,228 | supabase-export-v2 | c46647b6c83c0876 | >>> digits_re = r'\d+' >>> sample = '/usr/sbin/sendmail - 0 errors, 12 warnings' >>> print(re.sub(digits_re, digits_re.replace('\\', r'\\'), sample)) /usr/sbin/sendmail - \d+ errors, \d+ warnings
.. versionchanged:: 3.3
The ``'_'`` character is no longer escaped. | trusted_official_docs | CPython Docs | >>> digits_re = r'\d+' >>> sample = '/usr/sbin/sendmail - 0 errors, 12 warnings' >>> print(re.sub(digits_re, digits_re.replace('\\', r'\\'), sample)) /usr/sbin/sendmail - \d+ errors, \d+ warnings
.. versionchanged:: 3.3
The ``'_'`` character is no longer escaped. | >>> digits_re = r'\d+' >>> sample = '/usr/sbin/sendmail - 0 errors, 12 warnings' >>> print(re.sub(digits_re, digits_re.replace('\\', r'\\'), sample)) /usr/sbin/sendmail - \d+ errors, \d+ warnings
.. versionchanged:: 3.3
The ``'_'`` character is no longer escaped. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fbb38062-c319-4a52-ae8a-8c5278793b63 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,018 | supabase-export-v2 | edf9d856238018c6 | (ASCII-only matching) * :const:`re.I` (ignore case) * :const:`re.L` (locale dependent) * :const:`re.M` (multi-line) * :const:`re.S` (dot matches all) * :const:`re.U` (Unicode matching) * :const:`re.X` (verbose)
(The flags are described in :ref:`contents-of-module-re`.)
This is useful if you wish to include the flags a... | trusted_official_docs | CPython Docs | (ASCII-only matching) * :const:`re.I` (ignore case) * :const:`re.L` (locale dependent) * :const:`re.M` (multi-line) * :const:`re.S` (dot matches all) * :const:`re.U` (Unicode matching) * :const:`re.X` (verbose)
(The flags are described in :ref:`contents-of-module-re`.)
This is useful if you wish to include the flags a... | (ASCII-only matching) * :const:`re.I` (ignore case) * :const:`re.L` (locale dependent) * :const:`re.M` (multi-line) * :const:`re.S` (dot matches all) * :const:`re.U` (Unicode matching) * :const:`re.X` (verbose)
(The flags are described in :ref:`contents-of-module-re`.)
This is useful if you wish to include the flags a... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fca3f04d-ceed-4f2c-8bea-064242bbc5a2 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,017 | supabase-export-v2 | ba1e8091b471829d | 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:
* :const:`re.A` (ASCII-only matching)
* :const:`re.I` (ignore case)
* :const:`re.L` (locale dependent)
* :const:`re.M` (multi-line)
* :co... | trusted_official_docs | CPython Docs | 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:
* :const:`re.A` (ASCII-only matching)
* :const:`re.I` (ignore case)
* :const:`re.L` (locale dependent)
* :const:`re.M` (multi-line)
* :co... | 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:
* :const:`re.A` (ASCII-only matching)
* :const:`re.I` (ignore case)
* :const:`re.L` (locale dependent)
* :const:`re.M` (multi-line)
* :co... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
fdfda644-8dd0-4be6-8764-dfa7e33df4e8 | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,323 | supabase-export-v2 | fc7bdc09e5837ffe | 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::
>>> m = re.search(r"(?P<adjective>\w+) (?P<animal>\w+)", "killer rabbit")
>>> m.groupdict()
{'adjective': 'killer', 'animal': 'rabbit'} | trusted_official_docs | CPython Docs | 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::
>>> m = re.search(r"(?P<adjective>\w+) (?P<animal>\w+)", "killer rabbit")
>>> m.groupdict()
{'adjective': 'killer', 'animal': 'rabbit'} | 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::
>>> m = re.search(r"(?P<adjective>\w+) (?P<animal>\w+)", "killer rabbit")
>>> m.groupdict()
{'adjective': 'killer', 'animal': 'rabbit'} | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ffd7ca36-ea4d-40fa-b616-36cbd3aee81f | CPython Docs | file://datasets/cpython/Doc/library/re.rst | unknown | 7e452c1f-1cda-46ff-a4db-79992d398fb2 | 51,077 | supabase-export-v2 | d5140d47c04ac77f | .. index:: single: \s; in regular expressions
``\s``
For Unicode (str) patterns:
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. | trusted_official_docs | CPython Docs | .. index:: single: \s; in regular expressions
``\s``
For Unicode (str) patterns:
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. | .. index:: single: \s; in regular expressions
``\s``
For Unicode (str) patterns:
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. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0298639e-6f87-49ec-8fc3-be3a2a49e941 | CPython Docs | file://datasets/cpython/Doc/library/mm.rst | unknown | 224c6169-c514-4d6d-aeb8-f7fe224b4da8 | 51,429 | supabase-export-v2 | c1a35b2c2f737734 | ******************* Multimedia Services *******************
The modules described in this chapter implement various algorithms or interfaces
that are mainly useful for multimedia applications. They are available at the
discretion of the installation. Here's an overview: | trusted_official_docs | CPython Docs | ******************* Multimedia Services *******************
The modules described in this chapter implement various algorithms or interfaces
that are mainly useful for multimedia applications. They are available at the
discretion of the installation. Here's an overview: | ******************* Multimedia Services *******************
The modules described in this chapter implement various algorithms or interfaces
that are mainly useful for multimedia applications. They are available at the
discretion of the installation. Here's an overview: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2013ba4c-b76b-468b-8e07-c9bc94f6b69e | CPython Docs | file://datasets/cpython/Doc/library/quopri.rst | unknown | 3cb34d74-e0cc-4bfe-bff8-ae398362e1e5 | 51,437 | supabase-export-v2 | 7a0ec0e727b6f877 | characters; the base64 encoding scheme available via the :mod:`base64` module is more compact if there are many such characters, as when sending a graphics file.
.. function:: decode(input, output, header=False) | trusted_official_docs | CPython Docs | characters; the base64 encoding scheme available via the :mod:`base64` module is more compact if there are many such characters, as when sending a graphics file.
.. function:: decode(input, output, header=False) | characters; the base64 encoding scheme available via the :mod:`base64` module is more compact if there are many such characters, as when sending a graphics file.
.. function:: decode(input, output, header=False) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39449da2-5fa4-4d8b-98b1-570722a6e2ab | CPython Docs | file://datasets/cpython/Doc/library/quopri.rst | unknown | 3cb34d74-e0cc-4bfe-bff8-ae398362e1e5 | 51,444 | supabase-export-v2 | f0c7f8b869c15bf7 | .. function:: encodestring(s, quotetabs=False, header=False)
Like :func:`encode`, except that it accepts a source :class:`bytes` and
returns the corresponding encoded :class:`bytes`. By default, it sends a
``False`` value to *quotetabs* parameter of the :func:`encode` function. | trusted_official_docs | CPython Docs | .. function:: encodestring(s, quotetabs=False, header=False)
Like :func:`encode`, except that it accepts a source :class:`bytes` and
returns the corresponding encoded :class:`bytes`. By default, it sends a
``False`` value to *quotetabs* parameter of the :func:`encode` function. | .. function:: encodestring(s, quotetabs=False, header=False)
Like :func:`encode`, except that it accepts a source :class:`bytes` and
returns the corresponding encoded :class:`bytes`. By default, it sends a
``False`` value to *quotetabs* parameter of the :func:`encode` function. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ab26eea-6139-45a2-908f-7c9a6aba7dae | CPython Docs | file://datasets/cpython/Doc/library/quopri.rst | unknown | 3cb34d74-e0cc-4bfe-bff8-ae398362e1e5 | 51,440 | supabase-export-v2 | cd039c3d94cc53c5 | .. function:: encode(input, output, quotetabs, header=False)
Encode the contents of the *input* file and write the resulting quoted-printable
data to the *output* file. *input* and *output* must be
:term:`binary file objects <file object>`. *quotetabs*, a
non-optional flag which controls whether to encode embedded s... | trusted_official_docs | CPython Docs | .. function:: encode(input, output, quotetabs, header=False)
Encode the contents of the *input* file and write the resulting quoted-printable
data to the *output* file. *input* and *output* must be
:term:`binary file objects <file object>`. *quotetabs*, a
non-optional flag which controls whether to encode embedded s... | .. function:: encode(input, output, quotetabs, header=False)
Encode the contents of the *input* file and write the resulting quoted-printable
data to the *output* file. *input* and *output* must be
:term:`binary file objects <file object>`. *quotetabs*, a
non-optional flag which controls whether to encode embedded s... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a3ba4d14-7f4b-4425-a98e-b0e398e4b7f4 | CPython Docs | file://datasets/cpython/Doc/library/quopri.rst | unknown | 3cb34d74-e0cc-4bfe-bff8-ae398362e1e5 | 51,438 | supabase-export-v2 | b4eea966b4b7a86f | .. function:: decode(input, output, header=False)
Decode the contents of the *input* file and write the resulting decoded binary
data to the *output* file. *input* and *output* must be :term:`binary file objects
<file object>`. If the optional argument *header* is present and true, underscore
will be decoded as spac... | trusted_official_docs | CPython Docs | .. function:: decode(input, output, header=False)
Decode the contents of the *input* file and write the resulting decoded binary
data to the *output* file. *input* and *output* must be :term:`binary file objects
<file object>`. If the optional argument *header* is present and true, underscore
will be decoded as spac... | .. function:: decode(input, output, header=False)
Decode the contents of the *input* file and write the resulting decoded binary
data to the *output* file. *input* and *output* must be :term:`binary file objects
<file object>`. If the optional argument *header* is present and true, underscore
will be decoded as spac... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
d6b165b1-2298-4929-9683-c3b574f69098 | CPython Docs | file://datasets/cpython/Doc/library/quopri.rst | unknown | 3cb34d74-e0cc-4bfe-bff8-ae398362e1e5 | 51,436 | supabase-export-v2 | 07494fcdc21332ba | --------------
This module performs quoted-printable transport encoding and decoding, as
defined in :rfc:`1521`: "MIME (Multipurpose Internet Mail Extensions) Part One:
Mechanisms for Specifying and Describing the Format of Internet Message Bodies". The quoted-printable encoding is designed for data where there are rel... | trusted_official_docs | CPython Docs | --------------
This module performs quoted-printable transport encoding and decoding, as
defined in :rfc:`1521`: "MIME (Multipurpose Internet Mail Extensions) Part One:
Mechanisms for Specifying and Describing the Format of Internet Message Bodies". The quoted-printable encoding is designed for data where there are rel... | --------------
This module performs quoted-printable transport encoding and decoding, as
defined in :rfc:`1521`: "MIME (Multipurpose Internet Mail Extensions) Part One:
Mechanisms for Specifying and Describing the Format of Internet Message Bodies". The quoted-printable encoding is designed for data where there are rel... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
f43de08f-573d-417c-8792-9871da85b612 | CPython Docs | file://datasets/cpython/Doc/library/quopri.rst | unknown | 3cb34d74-e0cc-4bfe-bff8-ae398362e1e5 | 51,439 | supabase-export-v2 | 37c856b198617505 | space. This is used to decode "Q"-encoded headers as described in :rfc:`1522`: "MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text".
.. function:: encode(input, output, quotetabs, header=False) | trusted_official_docs | CPython Docs | space. This is used to decode "Q"-encoded headers as described in :rfc:`1522`: "MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text".
.. function:: encode(input, output, quotetabs, header=False) | space. This is used to decode "Q"-encoded headers as described in :rfc:`1522`: "MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text".
.. function:: encode(input, output, quotetabs, header=False) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0066d2a2-9f42-4835-a1d4-0bcb4c49bdd3 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,485 | supabase-export-v2 | 08bcac3ea4a5882f | Environment configuration ^^^^^^^^^^^^^^^^^^^^^^^^^
When initializing :data:`TZPATH` (either at import time or whenever
:func:`reset_tzpath` is called with no arguments), the ``zoneinfo`` module will
use the environment variable ``PYTHONTZPATH``, if it exists, to set the search
path. | trusted_official_docs | CPython Docs | Environment configuration ^^^^^^^^^^^^^^^^^^^^^^^^^
When initializing :data:`TZPATH` (either at import time or whenever
:func:`reset_tzpath` is called with no arguments), the ``zoneinfo`` module will
use the environment variable ``PYTHONTZPATH``, if it exists, to set the search
path. | Environment configuration ^^^^^^^^^^^^^^^^^^^^^^^^^
When initializing :data:`TZPATH` (either at import time or whenever
:func:`reset_tzpath` is called with no arguments), the ``zoneinfo`` module will
use the environment variable ``PYTHONTZPATH``, if it exists, to set the search
path. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
00c8631d-6706-44a4-8489-2d92450d651b | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,555 | supabase-export-v2 | 8bf503d929e452f9 | -- when constructing a ``ZoneInfo`` from a key, the key is joined to each entry in the ``TZPATH``, and the first file found is used.
``TZPATH`` may contain only absolute paths, never relative paths,
regardless of how it is configured. | trusted_official_docs | CPython Docs | -- when constructing a ``ZoneInfo`` from a key, the key is joined to each entry in the ``TZPATH``, and the first file found is used.
``TZPATH`` may contain only absolute paths, never relative paths,
regardless of how it is configured. | -- when constructing a ``ZoneInfo`` from a key, the key is joined to each entry in the ``TZPATH``, and the first file found is used.
``TZPATH`` may contain only absolute paths, never relative paths,
regardless of how it is configured. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0316358c-33ed-4e39-aa4a-70dacbf6131f | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,523 | supabase-export-v2 | aa8f79dcbee355c1 | .. note::
Although it is a somewhat common practice to expose these to end users,
these values are designed to be primary keys for representing the
relevant zones and not necessarily user-facing elements. Projects like
CLDR (the Unicode Common Locale Data Repository) can be used to get
more user-friendly strings fr... | trusted_official_docs | CPython Docs | .. note::
Although it is a somewhat common practice to expose these to end users,
these values are designed to be primary keys for representing the
relevant zones and not necessarily user-facing elements. Projects like
CLDR (the Unicode Common Locale Data Repository) can be used to get
more user-friendly strings fr... | .. note::
Although it is a somewhat common practice to expose these to end users,
these values are designed to be primary keys for representing the
relevant zones and not necessarily user-facing elements. Projects like
CLDR (the Unicode Common Locale Data Repository) can be used to get
more user-friendly strings fr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0c1b4c71-6b5d-4936-9c69-c8c3363736e9 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,474 | supabase-export-v2 | 68c53e988d0c7579 | Data sources ------------
The ``zoneinfo`` module does not directly provide time zone data, and instead
pulls time zone information from the system time zone database or the
first-party PyPI package :pypi:`tzdata`, if available. Some systems, including
notably Windows systems, do not have an IANA database available, an... | trusted_official_docs | CPython Docs | Data sources ------------
The ``zoneinfo`` module does not directly provide time zone data, and instead
pulls time zone information from the system time zone database or the
first-party PyPI package :pypi:`tzdata`, if available. Some systems, including
notably Windows systems, do not have an IANA database available, an... | Data sources ------------
The ``zoneinfo`` module does not directly provide time zone data, and instead
pulls time zone information from the system time zone database or the
first-party PyPI package :pypi:`tzdata`, if available. Some systems, including
notably Windows systems, do not have an IANA database available, an... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0d6c38df-17d4-4ec2-b2cc-4c031bf6dc27 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,544 | supabase-export-v2 | 33b637845bf2911f | containing all the valid keys for IANA time zones available anywhere on the time zone path. This is recalculated on every call to the function.
This function only includes canonical zone names and does not include
"special" zones such as those under the ``posix/`` and ``right/``
directories, the ``posixrules`` or the... | trusted_official_docs | CPython Docs | containing all the valid keys for IANA time zones available anywhere on the time zone path. This is recalculated on every call to the function.
This function only includes canonical zone names and does not include
"special" zones such as those under the ``posix/`` and ``right/``
directories, the ``posixrules`` or the... | containing all the valid keys for IANA time zones available anywhere on the time zone path. This is recalculated on every call to the function.
This function only includes canonical zone names and does not include
"special" zones such as those under the ``posix/`` and ``right/``
directories, the ``posixrules`` or the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0de2d819-9dd1-4418-99c8-3a0bbe61bba9 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,532 | supabase-export-v2 | 6a785236c7331ccd | transition data, ``ZoneInfo`` objects are serialized by key, and ``ZoneInfo`` objects constructed from files (even those with a value for ``key`` specified) cannot be pickled.
The behavior of a ``ZoneInfo`` file depends on how it was constructed: | trusted_official_docs | CPython Docs | transition data, ``ZoneInfo`` objects are serialized by key, and ``ZoneInfo`` objects constructed from files (even those with a value for ``key`` specified) cannot be pickled.
The behavior of a ``ZoneInfo`` file depends on how it was constructed: | transition data, ``ZoneInfo`` objects are serialized by key, and ``ZoneInfo`` objects constructed from files (even those with a value for ``key`` specified) cannot be pickled.
The behavior of a ``ZoneInfo`` file depends on how it was constructed: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
0f0f43df-ee55-42de-8309-c3fdfcb0a306 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,514 | supabase-export-v2 | 956951ddb3d068f7 | If no arguments are passed, all caches are invalidated and the next call to the primary constructor for each key will return a new instance.
If an iterable of key names is passed to the ``only_keys`` parameter, only
the specified keys will be removed from the cache. Keys passed to
``only_keys`` but not found in the c... | trusted_official_docs | CPython Docs | If no arguments are passed, all caches are invalidated and the next call to the primary constructor for each key will return a new instance.
If an iterable of key names is passed to the ``only_keys`` parameter, only
the specified keys will be removed from the cache. Keys passed to
``only_keys`` but not found in the c... | If no arguments are passed, all caches are invalidated and the next call to the primary constructor for each key will return a new instance.
If an iterable of key names is passed to the ``only_keys`` parameter, only
the specified keys will be removed from the cache. Keys passed to
``only_keys`` but not found in the c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
105de540-6274-44ec-a078-a85a53f261b5 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,488 | supabase-export-v2 | f532b39637e53117 | relative path is specified is implementation-defined; CPython will raise :exc:`InvalidTZPathWarning`, but other implementations are free to silently ignore the erroneous component or raise an exception.
To set the system to ignore the system data and use the tzdata package
instead, set ``PYTHONTZPATH=""``. | trusted_official_docs | CPython Docs | relative path is specified is implementation-defined; CPython will raise :exc:`InvalidTZPathWarning`, but other implementations are free to silently ignore the erroneous component or raise an exception.
To set the system to ignore the system data and use the tzdata package
instead, set ``PYTHONTZPATH=""``. | relative path is specified is implementation-defined; CPython will raise :exc:`InvalidTZPathWarning`, but other implementations are free to silently ignore the erroneous component or raise an exception.
To set the system to ignore the system data and use the tzdata package
instead, set ``PYTHONTZPATH=""``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
11c00a49-fcbe-4d28-a48c-baa91f6fcb18 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,481 | supabase-export-v2 | 429c26bf1c50574c | Compile-time configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^
The default :data:`TZPATH` includes several common deployment locations for the
time zone database (except on Windows, where there are no "well-known"
locations for time zone data). On POSIX systems, downstream distributors and
those building Python from source who ... | trusted_official_docs | CPython Docs | Compile-time configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^
The default :data:`TZPATH` includes several common deployment locations for the
time zone database (except on Windows, where there are no "well-known"
locations for time zone data). On POSIX systems, downstream distributors and
those building Python from source who ... | Compile-time configuration ^^^^^^^^^^^^^^^^^^^^^^^^^^
The default :data:`TZPATH` includes several common deployment locations for the
time zone database (except on Windows, where there are no "well-known"
locations for time zone data). On POSIX systems, downstream distributors and
those building Python from source who ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1413a9a6-fd21-467a-833a-18e4e0a83258 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,533 | supabase-export-v2 | 5d217d1d549b3662 | The behavior of a ``ZoneInfo`` file depends on how it was constructed:
1. ``ZoneInfo(key)``: When constructed with the primary constructor, a
``ZoneInfo`` object is serialized by key, and when deserialized, the
deserializing process uses the primary and thus it is expected that these
are the same object as other ref... | trusted_official_docs | CPython Docs | The behavior of a ``ZoneInfo`` file depends on how it was constructed:
1. ``ZoneInfo(key)``: When constructed with the primary constructor, a
``ZoneInfo`` object is serialized by key, and when deserialized, the
deserializing process uses the primary and thus it is expected that these
are the same object as other ref... | The behavior of a ``ZoneInfo`` file depends on how it was constructed:
1. ``ZoneInfo(key)``: When constructed with the primary constructor, a
``ZoneInfo`` object is serialized by key, and when deserialized, the
deserializing process uses the primary and thus it is expected that these
are the same object as other ref... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
16047d31-9174-4590-94a6-961bac425d22 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,507 | supabase-export-v2 | bca658b80be6d17a | likely to be useful for testing or demonstration purposes, but it can also be used to create a system with a different cache invalidation strategy.
Objects created via this constructor will also bypass the cache of a
deserializing process when unpickled. | trusted_official_docs | CPython Docs | likely to be useful for testing or demonstration purposes, but it can also be used to create a system with a different cache invalidation strategy.
Objects created via this constructor will also bypass the cache of a
deserializing process when unpickled. | likely to be useful for testing or demonstration purposes, but it can also be used to create a system with a different cache invalidation strategy.
Objects created via this constructor will also bypass the cache of a
deserializing process when unpickled. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
168d3f71-bc6a-4e48-9c54-8388a9386b63 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,452 | supabase-export-v2 | c8007a7c94f2e5f7 | --------------
The :mod:`!zoneinfo` module provides a concrete time zone implementation to
support the IANA time zone database as originally specified in :pep:`615`. By
default, :mod:`!zoneinfo` uses the system's time zone data if available; if no
system time zone data is available, the library will fall back to using ... | trusted_official_docs | CPython Docs | --------------
The :mod:`!zoneinfo` module provides a concrete time zone implementation to
support the IANA time zone database as originally specified in :pep:`615`. By
default, :mod:`!zoneinfo` uses the system's time zone data if available; if no
system time zone data is available, the library will fall back to using ... | --------------
The :mod:`!zoneinfo` module provides a concrete time zone implementation to
support the IANA time zone database as originally specified in :pep:`615`. By
default, :mod:`!zoneinfo` uses the system's time zone data if available; if no
system time zone data is available, the library will fall back to using ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
175ca2df-411d-4f95-b51f-2bf60fba2939 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,491 | supabase-export-v2 | 23848f40a6f4e011 | Runtime configuration ^^^^^^^^^^^^^^^^^^^^^
The TZ search path can also be configured at runtime using the
:func:`reset_tzpath` function. This is generally not an advisable operation,
though it is reasonable to use it in test functions that require the use of a
specific time zone path (or require disabling access to th... | trusted_official_docs | CPython Docs | Runtime configuration ^^^^^^^^^^^^^^^^^^^^^
The TZ search path can also be configured at runtime using the
:func:`reset_tzpath` function. This is generally not an advisable operation,
though it is reasonable to use it in test functions that require the use of a
specific time zone path (or require disabling access to th... | Runtime configuration ^^^^^^^^^^^^^^^^^^^^^
The TZ search path can also be configured at runtime using the
:func:`reset_tzpath` function. This is generally not an advisable operation,
though it is reasonable to use it in test functions that require the use of a
specific time zone path (or require disabling access to th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
184a8912-a73c-4467-a907-7b77e78965d3 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,554 | supabase-export-v2 | 767b6282edc3b9bd | .. data:: TZPATH
A read-only sequence representing the time zone search path -- when
constructing a ``ZoneInfo`` from a key, the key is joined to each entry in
the ``TZPATH``, and the first file found is used. | trusted_official_docs | CPython Docs | .. data:: TZPATH
A read-only sequence representing the time zone search path -- when
constructing a ``ZoneInfo`` from a key, the key is joined to each entry in
the ``TZPATH``, and the first file found is used. | .. data:: TZPATH
A read-only sequence representing the time zone search path -- when
constructing a ``ZoneInfo`` from a key, the key is joined to each entry in
the ``TZPATH``, and the first file found is used. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
1c879de6-a701-4b35-92ae-ec01ff16e1ef | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,502 | supabase-export-v2 | b66ee1c6b925fa58 | file-like object returning bytes (e.g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike the primary constructor, this always constructs a new object.
The ``key`` parameter sets the name of the zone for the purposes of
:py:meth:`~object.__str__` and :py:meth:`~object.__repr__`. | trusted_official_docs | CPython Docs | file-like object returning bytes (e.g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike the primary constructor, this always constructs a new object.
The ``key`` parameter sets the name of the zone for the purposes of
:py:meth:`~object.__str__` and :py:meth:`~object.__repr__`. | file-like object returning bytes (e.g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike the primary constructor, this always constructs a new object.
The ``key`` parameter sets the name of the zone for the purposes of
:py:meth:`~object.__str__` and :py:meth:`~object.__repr__`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
221099d0-1079-4acc-92d7-eb3338c29b72 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,518 | supabase-export-v2 | cb45a5c60210838e | using ``ZoneInfo`` in surprising ways; this modifies module state and thus may have wide-ranging effects. Only use it if you know that you need to.
The class has one attribute: | trusted_official_docs | CPython Docs | using ``ZoneInfo`` in surprising ways; this modifies module state and thus may have wide-ranging effects. Only use it if you know that you need to.
The class has one attribute: | using ``ZoneInfo`` in surprising ways; this modifies module state and thus may have wide-ranging effects. Only use it if you know that you need to.
The class has one attribute: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3048e3c8-55d4-4705-b26a-c36d203e2c79 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,539 | supabase-export-v2 | d76874e9194069c8 | >>> a = ZoneInfo("Europe/Berlin") >>> b = pickle.loads(europe_berlin_pkl_nc) >>> a is b False
3. ``ZoneInfo.from_file(file_obj, /, key=None)``: When constructed from a file, the
``ZoneInfo`` object raises an exception on pickling. If an end user wants to
pickle a ``ZoneInfo`` constructed from a file, it is recommende... | trusted_official_docs | CPython Docs | >>> a = ZoneInfo("Europe/Berlin") >>> b = pickle.loads(europe_berlin_pkl_nc) >>> a is b False
3. ``ZoneInfo.from_file(file_obj, /, key=None)``: When constructed from a file, the
``ZoneInfo`` object raises an exception on pickling. If an end user wants to
pickle a ``ZoneInfo`` constructed from a file, it is recommende... | >>> a = ZoneInfo("Europe/Berlin") >>> b = pickle.loads(europe_berlin_pkl_nc) >>> a is b False
3. ``ZoneInfo.from_file(file_obj, /, key=None)``: When constructed from a file, the
``ZoneInfo`` object raises an exception on pickling. If an end user wants to
pickle a ``ZoneInfo`` constructed from a file, it is recommende... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
37cc8414-5e84-476b-a289-539a834cf49a | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,494 | supabase-export-v2 | 4ddbc139499eda70 | .. class:: ZoneInfo(key)
A concrete :class:`datetime.tzinfo` subclass that represents an IANA time
zone specified by the string ``key``. Calls to the primary constructor will
always return objects that compare identically; put another way, barring
cache invalidation via :meth:`ZoneInfo.clear_cache`, for all values o... | trusted_official_docs | CPython Docs | .. class:: ZoneInfo(key)
A concrete :class:`datetime.tzinfo` subclass that represents an IANA time
zone specified by the string ``key``. Calls to the primary constructor will
always return objects that compare identically; put another way, barring
cache invalidation via :meth:`ZoneInfo.clear_cache`, for all values o... | .. class:: ZoneInfo(key)
A concrete :class:`datetime.tzinfo` subclass that represents an IANA time
zone specified by the string ``key``. Calls to the primary constructor will
always return objects that compare identically; put another way, barring
cache invalidation via :meth:`ZoneInfo.clear_cache`, for all values o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
435b0e49-f0d9-40c0-979e-3c6d5727d9cf | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,482 | supabase-export-v2 | 3da7487b08d4d94e | time zone path by specifying the compile-time option ``TZPATH`` (or, more likely, the :option:`configure flag --with-tzpath <--with-tzpath>`), which should be a string delimited by :data:`os.pathsep`.
On all platforms, the configured value is available as the ``TZPATH`` key in
:func:`sysconfig.get_config_var`. | trusted_official_docs | CPython Docs | time zone path by specifying the compile-time option ``TZPATH`` (or, more likely, the :option:`configure flag --with-tzpath <--with-tzpath>`), which should be a string delimited by :data:`os.pathsep`.
On all platforms, the configured value is available as the ``TZPATH`` key in
:func:`sysconfig.get_config_var`. | time zone path by specifying the compile-time option ``TZPATH`` (or, more likely, the :option:`configure flag --with-tzpath <--with-tzpath>`), which should be a string delimited by :data:`os.pathsep`.
On all platforms, the configured value is available as the ``TZPATH`` key in
:func:`sysconfig.get_config_var`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4ba5f9c9-6948-460c-a881-56a29914d41c | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,477 | supabase-export-v2 | 12d2aa5d987d6755 | Configuring the data sources ****************************
When ``ZoneInfo(key)`` is called, the constructor first searches the
directories specified in :data:`TZPATH` for a file matching ``key``, and on
failure looks for a match in the tzdata package. This behavior can be
configured in three ways: | trusted_official_docs | CPython Docs | Configuring the data sources ****************************
When ``ZoneInfo(key)`` is called, the constructor first searches the
directories specified in :data:`TZPATH` for a file matching ``key``, and on
failure looks for a match in the tzdata package. This behavior can be
configured in three ways: | Configuring the data sources ****************************
When ``ZoneInfo(key)`` is called, the constructor first searches the
directories specified in :data:`TZPATH` for a file matching ``key``, and on
failure looks for a match in the tzdata package. This behavior can be
configured in three ways: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52dcbe1b-dc82-45de-bad6-c7a67df239b0 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,501 | supabase-export-v2 | 4ba815278f9ccfda | .. classmethod:: ZoneInfo.from_file(file_obj, /, key=None)
Constructs a ``ZoneInfo`` object from a file-like object returning bytes
(e.g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike the primary constructor, this always constructs a new object. | trusted_official_docs | CPython Docs | .. classmethod:: ZoneInfo.from_file(file_obj, /, key=None)
Constructs a ``ZoneInfo`` object from a file-like object returning bytes
(e.g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike the primary constructor, this always constructs a new object. | .. classmethod:: ZoneInfo.from_file(file_obj, /, key=None)
Constructs a ``ZoneInfo`` object from a file-like object returning bytes
(e.g. a file opened in binary mode or an :class:`io.BytesIO` object). Unlike the primary constructor, this always constructs a new object. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56ed23c9-a5fa-4012-8924-ed0b4bce91b0 | CPython Docs | file://datasets/cpython/Doc/library/zoneinfo.rst | unknown | c2d9f1e5-ab0a-4465-86be-6e2bc5771bf4 | 51,540 | supabase-export-v2 | 667dfa5fa8132f43 | they use a wrapper type or a custom serialization function: either serializing by key or storing the contents of the file object and serializing that.
This method of serialization requires that the time zone data for the required
key be available on both the serializing and deserializing side, similar to the
way that r... | trusted_official_docs | CPython Docs | they use a wrapper type or a custom serialization function: either serializing by key or storing the contents of the file object and serializing that.
This method of serialization requires that the time zone data for the required
key be available on both the serializing and deserializing side, similar to the
way that r... | they use a wrapper type or a custom serialization function: either serializing by key or storing the contents of the file object and serializing that.
This method of serialization requires that the time zone data for the required
key be available on both the serializing and deserializing side, similar to the
way that r... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.