1
0
Fork 0
python-docs-fr/library/re.po

2088 lines
84 KiB
Plaintext
Raw Normal View History

2016-10-30 09:46:26 +00:00
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2016, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
2017-05-27 17:46:38 +00:00
"POT-Creation-Date: 2017-05-27 19:40+0200\n"
2016-10-30 09:46:26 +00:00
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
2017-05-23 22:40:56 +00:00
"Language: fr\n"
2016-10-30 09:46:26 +00:00
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../Doc/library/re.rst:2
msgid ":mod:`re` --- Regular expression operations"
2017-05-27 14:30:14 +00:00
msgstr ":mod:`re` --- Opérations à base d'expressions rationnelles"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/re.rst:10
msgid "**Source code:** :source:`Lib/re.py`"
2017-05-27 14:30:14 +00:00
msgstr "**Code source :** :source:`Lib/re.py`"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/re.rst:14
msgid ""
"This module provides regular expression matching operations similar to those "
"found in Perl."
msgstr ""
2017-05-27 14:30:14 +00:00
"Ce module fournit des opérations sur les expressions rationnelles "
"similaires à celles que l'on trouve dans Perl."
2016-10-30 09:46:26 +00:00
#: ../Doc/library/re.rst:17
msgid ""
"Both patterns and strings to be searched can be Unicode strings as well as 8-"
"bit strings. However, Unicode strings and 8-bit strings cannot be mixed: "
"that is, you cannot match a Unicode string with a byte pattern or vice-"
"versa; similarly, when asking for a substitution, the replacement string "
"must be of the same type as both the pattern and the search string."
msgstr ""
2017-05-27 14:30:14 +00:00
"Motifs comme chaînes à analyser peuvent aussi bien être des chaînes Unicode "
"que des chaînes 8-bit. Cependant, chaînes Unicode et 8-bit ne peuvent pas "
"être mélangées : vous ne pouvez ainsi pas analyser une chaîne Unicode avec "
"un motif 8-bit, et inversement ; similairement, lors d'une substitution, la "
"chaîne de remplacement doit être du même type que le motif et la chaîne "
"analysée."
2016-10-30 09:46:26 +00:00
#: ../Doc/library/re.rst:23
msgid ""
"Regular expressions use the backslash character (``'\\'``) to indicate "
"special forms or to allow special characters to be used without invoking "
"their special meaning. This collides with Python's usage of the same "
"character for the same purpose in string literals; for example, to match a "
"literal backslash, one might have to write ``'\\\\\\\\'`` as the pattern "
"string, because the regular expression must be ``\\\\``, and each backslash "
"must be expressed as ``\\\\`` inside a regular Python string literal."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les expressions rationnelles utilisent le caractère *backslash* (``'\\'``) "
"pour indiquer des formes spéciales ou permettre d'utiliser des caractères "
"spéciaux sans en invoquer le sens. Cela entre en conflit avec l'utilisation "
"en Python du même caractère pour la même raison dans les chaînes "
"littérales ; par exemple, pour rechercher un *backslash* littéral il "
"faudrait écrire ``'\\\\\\\\'`` comme motif, parce que l'expression "
"rationnelle devrait être ``\\\\``, et chaque *backslash* exprimé par ``\\"
"\\`` au sein des chaînes littérales Python."
2016-10-30 09:46:26 +00:00
#: ../Doc/library/re.rst:32
msgid ""
"The solution is to use Python's raw string notation for regular expression "
"patterns; backslashes are not handled in any special way in a string literal "
"prefixed with ``'r'``. So ``r\"\\n\"`` is a two-character string containing "
"``'\\'`` and ``'n'``, while ``\"\\n\"`` is a one-character string containing "
"a newline. Usually patterns will be expressed in Python code using this raw "
"string notation."
msgstr ""
2017-05-27 14:30:14 +00:00
"La solution est d'utiliser la notation des chaînes brutes en Python pour les "
"expressions rationnelles ; Les *backslashes* ne provoquent aucun traitement "
"spécifique dans les chaînes littérales préfixées par ``'r'``. Ainsi, ``r"
"\"\\n\"`` est une chaîne de deux caractères contenant ``'\\'`` et ``'n'``, "
"tandis que ``\"\\n\"`` est une chaîne contenant un unique caractère : un "
"saut de ligne. Généralement, les motifs seront exprimés en Python à l'aide "
"de chaînes brutes."
2016-10-30 09:46:26 +00:00
#: ../Doc/library/re.rst:39
msgid ""
"It is important to note that most regular expression operations are "
"available as module-level functions and methods on :ref:`compiled regular "
"expressions <re-objects>`. The functions are shortcuts that don't require "
"you to compile a regex object first, but miss some fine-tuning parameters."
msgstr ""
2017-05-27 14:30:14 +00:00
"Il est important de noter que la plupart des opérations sur les expressions "
"rationnelles sont disponibles comme fonctions au niveau du module et comme "
"méthodes des :ref:`expressions rationnelles compilées <re-objects>`. Les "
"fonctions sont des raccourcis qui ne vous obligent pas à d'abord compiler un "
"objet *regex*, mais auxquelles manquent certains paramètres de configuration "
"fine."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:47
msgid ""
"The third-party `regex <https://pypi.python.org/pypi/regex/>`_ module, which "
"has an API compatible with the standard library :mod:`re` module, but offers "
"additional functionality and a more thorough Unicode support."
msgstr ""
2017-05-27 14:30:14 +00:00
"Le module tiers `regex <https://pypi.python.org/pypi/regex/>`_, dont "
"l'interface est compatible avec le module :mod:`re` de la bibliothèque "
"standard, mais offre des fonctionnalités additionnelles et un meilleur "
"support de l'Unicode."
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:55
2016-10-30 09:46:26 +00:00
msgid "Regular Expression Syntax"
2017-05-27 14:30:14 +00:00
msgstr "Syntaxe des Expressions Rationnelles"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:57
2016-10-30 09:46:26 +00:00
msgid ""
"A regular expression (or RE) specifies a set of strings that matches it; the "
"functions in this module let you check if a particular string matches a "
"given regular expression (or if a given regular expression matches a "
"particular string, which comes down to the same thing)."
msgstr ""
2017-05-27 14:30:14 +00:00
"Une expression rationnelle (*regular expression* ou *RE*) spécifie un "
"ensemble de chaînes de caractères qui lui correspondent ; les fonctions de "
"ce module vous permettent de vérifier si une chaîne particulière correspond "
"à une expression rationnelle donnée (ou si un expression rationnelle donnée "
"correspond à une chaîne particulière, ce qui revient à la même chose)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:62
2016-10-30 09:46:26 +00:00
msgid ""
"Regular expressions can be concatenated to form new regular expressions; if "
"*A* and *B* are both regular expressions, then *AB* is also a regular "
"expression. In general, if a string *p* matches *A* and another string *q* "
"matches *B*, the string *pq* will match AB. This holds unless *A* or *B* "
"contain low precedence operations; boundary conditions between *A* and *B*; "
"or have numbered group references. Thus, complex expressions can easily be "
"constructed from simpler primitive expressions like the ones described "
"here. For details of the theory and implementation of regular expressions, "
"consult the Friedl book referenced above, or almost any textbook about "
"compiler construction."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les expressions rationnelles peuvent être concaténées pour former de "
"nouvelles expressions : si *A* et *B* sont deux expressions rationnelles, "
"alors *AB* est aussi une expression rationnelle. En général, si une chaîne "
"*p* valide *A* et qu'une autre chaîne *q* valide *B*, la chaîne *pq* "
"validera AB. Cela est vrai tant que *A* et *B* ne contiennent pas "
"d'opérations de précédence ; de conditions liées entre *A* et *B* ; ou de "
"références vers des groupes numérotés. Ainsi, des expressions complexes "
"peuvent facilement être construites depuis de plus simples expressions "
"primitives comme celles décrites ici. Pour plus de détails sur la théorie "
"et l'implémentation des expressions rationnelles, consultez le livre de "
"Frield référencé plus tôt, ou à peu près n'importe quel livre dédié à la "
"construction de compilateurs."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:72
2016-10-30 09:46:26 +00:00
msgid ""
"A brief explanation of the format of regular expressions follows. For "
"further information and a gentler presentation, consult the :ref:`regex-"
"howto`."
msgstr ""
2017-05-27 14:30:14 +00:00
"Une brève explication sur le format des expressions rationnelles suit. Pour "
"de plus amples informations, et une meilleure présentation, référez-vous au :"
"ref:`regex-howto`."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:75
2016-10-30 09:46:26 +00:00
msgid ""
"Regular expressions can contain both special and ordinary characters. Most "
"ordinary characters, like ``'A'``, ``'a'``, or ``'0'``, are the simplest "
"regular expressions; they simply match themselves. You can concatenate "
"ordinary characters, so ``last`` matches the string ``'last'``. (In the "
"rest of this section, we'll write RE's in ``this special style``, usually "
"without quotes, and strings to be matched ``'in single quotes'``.)"
msgstr ""
2017-05-27 14:30:14 +00:00
"Les expressions rationnelles peuvent contenir à la fois des caractères "
"spéciaux et ordinaires. Les plus ordinaires, comme ``'A'``, ``'a'`` ou "
"``'0'`` sont les expressions rationnelles les plus simples : elles "
"correspondent simplement à elles-mêmes. Vous pouvez concaténer deux "
"caractères ordinaires, donc ``last`` correspond à la chaîne ``'last'``. "
"(Dans la suite de cette section, nous écrirons les expressions rationnelles "
"dans ``ce style spécifique``, généralement sans guillemets, et les chaînes à "
"tester ``'entourées de simples guillemets'``.)"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:82
2016-10-30 09:46:26 +00:00
msgid ""
"Some characters, like ``'|'`` or ``'('``, are special. Special characters "
"either stand for classes of ordinary characters, or affect how the regular "
"expressions around them are interpreted. Regular expression pattern strings "
"may not contain null bytes, but can specify the null byte using a ``"
"\\number`` notation such as ``'\\x00'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Certains caractères, comme ``'|'`` ou ``'('``, sont spéciaux. Des caractères "
"spéciaux peuvent aussi exister pour les classes de caractères ordinaires, ou "
"affecter comment les expressions rationnelles autour d'eux seront "
"interprétées. Les motifs d'expressions rationnelles ne devraient pas "
"contenir de caractères nuls, mais peuvent spécifier le caractère nul en "
"utilisant une notation ``\\number`` comme ``\\x00``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:88
2016-10-30 09:46:26 +00:00
msgid ""
"Repetition qualifiers (``*``, ``+``, ``?``, ``{m,n}``, etc) cannot be "
"directly nested. This avoids ambiguity with the non-greedy modifier suffix "
"``?``, and with other modifiers in other implementations. To apply a second "
"repetition to an inner repetition, parentheses may be used. For example, the "
"expression ``(?:a{6})*`` matches any multiple of six ``'a'`` characters."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les caractères de répétition (``*``, ``+``, ``?``, ``{m,n}``, etc.) ne "
"peuvent être directement imbriqués. Cela empêche l'ambiguïté avec le suffixe "
"modificateur non gourmand ``?``, et avec les autres modificateurs dans "
"d'autres implémentations. Pour appliquer une seconde répétition à une "
"première, des parenthèses peuvent être utilisées. Par exemple, l'expression "
"``(?:a{6})*`` valide toutes les chaînes composées d'un nombre de caractères "
"``'a'`` multiple de six."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:95
2016-10-30 09:46:26 +00:00
msgid "The special characters are:"
2017-05-27 14:30:14 +00:00
msgstr "Les caractères spéciaux sont :"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:100
2016-10-30 09:46:26 +00:00
msgid "``'.'``"
msgstr "``'.'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:98
2016-10-30 09:46:26 +00:00
msgid ""
"(Dot.) In the default mode, this matches any character except a newline. "
"If the :const:`DOTALL` flag has been specified, this matches any character "
"including a newline."
msgstr ""
2017-05-27 14:30:14 +00:00
"(Point.) Dans le mode par défaut, il valide tout caractère à l'exception du "
"saut de ligne. Si l'option :const:`DOTALL` a été spécifiée, il valide tout "
"caractère, saut de ligne compris."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:104
2016-10-30 09:46:26 +00:00
msgid "``'^'``"
msgstr "``'^'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:103
2016-10-30 09:46:26 +00:00
msgid ""
"(Caret.) Matches the start of the string, and in :const:`MULTILINE` mode "
"also matches immediately after each newline."
msgstr ""
2017-05-27 14:30:14 +00:00
"(Accent circonflexe.) Valide le début d'une chaîne de caractères, ainsi que "
"ce qui suit chaque saut de ligne en mode :const:`MULTILINE`."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:113
2016-10-30 09:46:26 +00:00
msgid "``'$'``"
msgstr "``'$'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:107
2016-10-30 09:46:26 +00:00
msgid ""
"Matches the end of the string or just before the newline at the end of the "
"string, and in :const:`MULTILINE` mode also matches before a newline. "
"``foo`` matches both 'foo' and 'foobar', while the regular expression ``foo"
"$`` matches only 'foo'. More interestingly, searching for ``foo.$`` in "
"``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' in :const:"
"`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` will find two "
"(empty) matches: one just before the newline, and one at the end of the "
"string."
msgstr ""
2017-05-27 14:30:14 +00:00
"Valide la fin d'une chaîne de caractères, ou juste avant le saut de ligne à "
"la fin de la chaîne, ainsi qu'avant chaque saut de ligne en mode :const:"
"`MULTILINE`. ``foo`` valide à la fois 'foo' et 'foobar', tandis que "
"l'expression rationnelle ``foo$`` ne correspond qu'à 'foo'. Plus "
"intéressant, chercher ``foo.$`` dans ``'foo1\\nfoo2\\n'`` trouve normalement "
"'foo2', mais 'foo1' en mode :const:`MULTILINE` ; chercher un simple ``$`` "
"dans ``'foo\\n'`` trouvera deux correspondances (vides) : une juste avant le "
"saut de ligne, et une à la fin de la chaîne."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:118
2016-10-30 09:46:26 +00:00
msgid "``'*'``"
msgstr "``'*'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:116
2016-10-30 09:46:26 +00:00
msgid ""
"Causes the resulting RE to match 0 or more repetitions of the preceding RE, "
"as many repetitions as are possible. ``ab*`` will match 'a', 'ab', or 'a' "
"followed by any number of 'b's."
msgstr ""
2017-05-27 14:30:14 +00:00
"Implique à l'expression rationnelle résultante de valider 0 répétition ou "
"plus de l'expression qui précède, avec autant de répétitions que possible. "
"``ab*`` validera 'a', 'ab' ou 'a' suivi de n'importe quel nombre de 'b'."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:123
2016-10-30 09:46:26 +00:00
msgid "``'+'``"
msgstr "``'+'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:121
2016-10-30 09:46:26 +00:00
msgid ""
"Causes the resulting RE to match 1 or more repetitions of the preceding RE. "
"``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not "
"match just 'a'."
msgstr ""
2017-05-27 14:30:14 +00:00
"Implique à l'expression rationnelle résultante de valider une répétition ou "
"plus de l'expression qui précède. ``ab+`` validera 'a' suivi de n'importe "
"quel nombre non nul de 'b' ; ça ne validera pas la chaîne 'a'."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:127
2016-10-30 09:46:26 +00:00
msgid "``'?'``"
msgstr "``'?'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:126
2016-10-30 09:46:26 +00:00
msgid ""
"Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. "
"``ab?`` will match either 'a' or 'ab'."
msgstr ""
2017-05-27 14:30:14 +00:00
"Implique à l'expression rationnelle résultante de valider 0 ou 1 répétition "
"de l'expression qui précède. ``ab?`` correspondra à la fois à 'a' et 'ab'."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:136
2016-10-30 09:46:26 +00:00
msgid "``*?``, ``+?``, ``??``"
msgstr "``*?``, ``+?``, ``??``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:130
2016-10-30 09:46:26 +00:00
msgid ""
"The ``'*'``, ``'+'``, and ``'?'`` qualifiers are all :dfn:`greedy`; they "
"match as much text as possible. Sometimes this behaviour isn't desired; if "
"the RE ``<.*>`` is matched against ``<a> b <c>``, it will match the entire "
"string, and not just ``<a>``. Adding ``?`` after the qualifier makes it "
"perform the match in :dfn:`non-greedy` or :dfn:`minimal` fashion; as *few* "
"characters as possible will be matched. Using the RE ``<.*?>`` will match "
"only ``<a>``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les qualificateurs ``'*'``, ``'+'`` et ``'?'`` sont tous :dfn:`greedy` "
"(gourmands) ; ils valident autant de texte que possible. Parfois ce "
"comportement n'est pas désiré ; si l'expression rationnelle ``<.*>`` est "
"testée avec la chaîne ``<a> b <c>``, cela correspondra à la chaîne entière, "
"et non juste à ``<a>``. Ajouter ``?`` derrière le qualificateur lui fait "
"réaliser l'opération de façon :dfn:`non-greedy` (ou :dfn:`minimal`) ; le "
"*moins* de caractères possibles seront validés. Utiliser l'expression "
"rationnelle ``<.*?>`` validera uniquement ``<a>``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:141
2016-10-30 09:46:26 +00:00
msgid "``{m}``"
msgstr "``{m}``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:139
2016-10-30 09:46:26 +00:00
msgid ""
"Specifies that exactly *m* copies of the previous RE should be matched; "
"fewer matches cause the entire RE not to match. For example, ``a{6}`` will "
"match exactly six ``'a'`` characters, but not five."
msgstr ""
2017-05-27 14:30:14 +00:00
"Spécifie qu'exactement *m* copies de l'expression rationnelle qui précède "
"devront être validées ; un nombre plus faible de correspondances empêche "
"l'expression entière de correspondre. Par exemple, ``a{6}`` correspondra "
"exactement à six caractères ``'a'``, mais pas à cinq."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:150
2016-10-30 09:46:26 +00:00
msgid "``{m,n}``"
msgstr "``{m,n}``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:144
2016-10-30 09:46:26 +00:00
msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as many repetitions as possible. For "
"example, ``a{3,5}`` will match from 3 to 5 ``'a'`` characters. Omitting *m* "
"specifies a lower bound of zero, and omitting *n* specifies an infinite "
"upper bound. As an example, ``a{4,}b`` will match ``aaaab`` or a thousand "
"``'a'`` characters followed by a ``b``, but not ``aaab``. The comma may not "
"be omitted or the modifier would be confused with the previously described "
"form."
msgstr ""
2017-05-27 14:30:14 +00:00
"Implique à l'expression rationnelle résultante de valider entre *m* et *n* "
"répétitions de l'expression qui précède, cherchant à en valider le plus "
"possible. Par exemple, ``a{3,5}`` validera entre 3 et 5 caractères "
"``'a'``. Omettre *m* revient à spécifier 0 comme borne inférieure, et "
"omettre *n* à avoir une borne supérieure infinie. Par exemple, ``a{4,}b`` "
"correspondra à ``aaaab`` ou à un millier de caractères ``'a'`` suivis d'un "
"``b``, mais pas à ``aaab``. La virgule ne doit pas être omise, auquel cas le "
"modificateur serait confondu avec la forme décrite précédemment."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:157
2016-10-30 09:46:26 +00:00
msgid "``{m,n}?``"
msgstr "``{m,n}?``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:153
2016-10-30 09:46:26 +00:00
msgid ""
"Causes the resulting RE to match from *m* to *n* repetitions of the "
"preceding RE, attempting to match as *few* repetitions as possible. This is "
"the non-greedy version of the previous qualifier. For example, on the 6-"
"character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters, "
"while ``a{3,5}?`` will only match 3 characters."
msgstr ""
2017-05-27 14:30:14 +00:00
"Implique à l'expression rationnelle résultante de valider entre *m* et *n* "
"répétitions de l'expression qui précède, cherchant à en valider le moins "
"possible. Il s'agit de la version non gourmande du précédent "
"qualificateur. Par exemple, dans la chaîne de 6 caractères ``'aaaaaa'``, "
"``a{3,5}`` trouvera 5 caractères ``'a'``, alors que ``a{3,5}?`` n'en "
"trouvera que 3."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:170
2016-10-30 09:46:26 +00:00
msgid "``'\\'``"
msgstr "``'\\'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:160
2016-10-30 09:46:26 +00:00
msgid ""
"Either escapes special characters (permitting you to match characters like "
"``'*'``, ``'?'``, and so forth), or signals a special sequence; special "
"sequences are discussed below."
msgstr ""
2017-05-27 14:30:14 +00:00
"Échappe à la fois les caractères spéciaux (permettant d'utiliser des "
"caractères comme ``'*'``, ``'?'`` et autres), ou signale une séquence "
"spéciale ; les séquences spéciales sont décrites ci-dessous."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:164
2016-10-30 09:46:26 +00:00
msgid ""
"If you're not using a raw string to express the pattern, remember that "
"Python also uses the backslash as an escape sequence in string literals; if "
"the escape sequence isn't recognized by Python's parser, the backslash and "
"subsequent character are included in the resulting string. However, if "
"Python would recognize the resulting sequence, the backslash should be "
"repeated twice. This is complicated and hard to understand, so it's highly "
"recommended that you use raw strings for all but the simplest expressions."
msgstr ""
2017-05-27 14:30:14 +00:00
"Si vous n'utilisez pas de chaînes brutes pour exprimer le motif, souvenez-"
"vous que Python utilise aussi le *backslash* comme une séquence "
"d'échappement dans les chaînes littérales ; si la séquence d'échappement "
"n'est pas reconnue par le parseur Python, le *backslash* et les caractères "
"qui le suivent sont inclus dans la chaîne retournée. Cependant, si Python "
"avait reconnu la séquence, le *backslash* aurait dû être doublé. C'est "
"assez compliqué et difficile à comprendre, c'est pourquoi il est hautement "
"recommandé d'utiliser des chaînes brutes pour tout sauf les expressions les "
"plus simples."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:202
2016-10-30 09:46:26 +00:00
msgid "``[]``"
msgstr "``[]``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:173
2016-10-30 09:46:26 +00:00
msgid "Used to indicate a set of characters. In a set:"
2017-05-27 14:30:14 +00:00
msgstr "Utilisé pour indiquer un ensemble de caractères. Dans un ensemble :"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:175
2016-10-30 09:46:26 +00:00
msgid ""
"Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, "
"``'m'``, or ``'k'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les caractères peuvent être listés individuellement, e.g. ``[amk]`` "
"correspondra à ``'a'``, ``'m'`` ou ``'k'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:178
2016-10-30 09:46:26 +00:00
msgid ""
"Ranges of characters can be indicated by giving two characters and "
"separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase "
"ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from "
"``00`` to ``59``, and ``[0-9A-Fa-f]`` will match any hexadecimal digit. If "
"``-`` is escaped (e.g. ``[a\\-z]``) or if it's placed as the first or last "
"character (e.g. ``[a-]``), it will match a literal ``'-'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Des intervalles de caractères peuvent être indiqués en donnant deux "
"caractères et les séparant par un ``'-'``, par exemple ``[a-z]`` "
"correspondra à toute lettre minuscule *ASCII*, ``[0-5][0-9]`` à tous nombres "
"de deux chiffres entre ``00` et ``59``, et ``[0-9A-Fa-f]`` correspondra à "
"n'importe quel chiffre hexadécimal. Si ``'-'`` est échappé (``[a\\-z]``) ou "
"s'il est placé comme premier ou dernier caractère (e.g. ``[a-]``), il "
"correspondra à un ``'-'`` littéral."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:185
2016-10-30 09:46:26 +00:00
msgid ""
"Special characters lose their special meaning inside sets. For example, "
"``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, "
"``'*'``, or ``')'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les caractères spéciaux perdent leur sens à l'intérieur des ensembles. Par "
"exemple, ``[(+*)]`` validera chacun des caractères littéraux ``'('``, "
"``'+'``, ``'*'`` ou ``')'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:189
2016-10-30 09:46:26 +00:00
msgid ""
"Character classes such as ``\\w`` or ``\\S`` (defined below) are also "
"accepted inside a set, although the characters they match depends on "
"whether :const:`ASCII` or :const:`LOCALE` mode is in force."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les classes de caractères telles que ``\\w`` ou ``\\S`` (définies ci-"
"dessous) sont aussi acceptées à l'intérieur d'un ensemble, bien que les "
"caractères correspondant dépendent de quel mode est actif entre :const:"
"`ASCII` et :const:`LOCALE`."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:193
2016-10-30 09:46:26 +00:00
msgid ""
"Characters that are not within a range can be matched by :dfn:"
"`complementing` the set. If the first character of the set is ``'^'``, all "
"the characters that are *not* in the set will be matched. For example, "
"``[^5]`` will match any character except ``'5'``, and ``[^^]`` will match "
"any character except ``'^'``. ``^`` has no special meaning if it's not the "
"first character in the set."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les caractères qui ne sont pas dans un intervalle peuvent être trouvés avec "
"l'ensemble complémentaire (:dfn:`complementing`). Si le premier caractère "
"de l'ensemble est ``'^'``, tous les caractères qui *ne sont pas* dans "
"l'ensemble seront validés. Par exemple, ``[^5]`` correspondra à tout "
"caractère autre que ``'5'``, et ``[^^]`` validera n'importe quel caractère "
"excepté ``'^'``. ``^`` n'a pas de sens particulier s'il n'est pas le "
"premier caractère de l'ensemble."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:200
2016-10-30 09:46:26 +00:00
msgid ""
"To match a literal ``']'`` inside a set, precede it with a backslash, or "
"place it at the beginning of the set. For example, both ``[()[\\]{}]`` and "
"``[]()[{}]`` will both match a parenthesis."
msgstr ""
2017-05-27 14:30:14 +00:00
"Pour insérer un ``']'`` littéral dans un ensemble, il faut le précéder d'un "
"*backslash* ou le placer au début de l'ensemble. Par exemple, ``[()[\\]"
"{}]`` et ``[]()[{}]`` vont tous deux correspondre à une parenthèse, un "
"crochet ou une accolade."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:213
2016-10-30 09:46:26 +00:00
msgid "``'|'``"
msgstr "``'|'``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:205
2016-10-30 09:46:26 +00:00
msgid ""
"``A|B``, where A and B can be arbitrary REs, creates a regular expression "
"that will match either A or B. An arbitrary number of REs can be separated "
"by the ``'|'`` in this way. This can be used inside groups (see below) as "
"well. As the target string is scanned, REs separated by ``'|'`` are tried "
"from left to right. When one pattern completely matches, that branch is "
"accepted. This means that once ``A`` matches, ``B`` will not be tested "
"further, even if it would produce a longer overall match. In other words, "
"the ``'|'`` operator is never greedy. To match a literal ``'|'``, use ``\\|"
"``, or enclose it inside a character class, as in ``[|]``."
msgstr ""
2017-05-27 14:30:14 +00:00
"``A|B``, où A et B peuvent être deux expressions rationnelles arbitraires, "
"crée une expression rationnelle qui validera à la fois A et B. Un nombre "
"arbitraire d'expressions peuvent être séparées de cette façon par des "
"``'|'``. Cela peut aussi être utilisé au sein de groupes (voir ci-"
"dessous). Quand une chaîne cible est analysée, les expressions séparées par "
"``'|'`` sont essayées de la gauche vers la droite. Quand un motif correspond "
"complètement, cette branche est acceptée. Cela signifie qu'une fois que "
"``A`` correspond, ``B`` ne sera pas testée plus loin, même si elle pourrait "
"provoquer une plus ample correspondance. En d'autres termes, l'opérateur "
"``'|'`` n'est jamais gourmand. Pour valider un ``'|'`` littéral, utilisez ``"
"\\|``, ou enveloppez-le dans une classe de caractères, comme ``[|]``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:220
2016-10-30 09:46:26 +00:00
msgid "``(...)``"
msgstr "``(...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:216
2016-10-30 09:46:26 +00:00
msgid ""
"Matches whatever regular expression is inside the parentheses, and indicates "
"the start and end of a group; the contents of a group can be retrieved after "
"a match has been performed, and can be matched later in the string with the "
"``\\number`` special sequence, described below. To match the literals "
"``'('`` or ``')'``, use ``\\(`` or ``\\)``, or enclose them inside a "
"character class: ``[(] [)]``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Valide n'importe quelle expression rationnelle comprise entre les "
"parenthèses, et indique le début et la fin d'un groupe ; le contenu d'un "
"groupe peut être récupéré après qu'une analyse a été effectuée, et peut être "
"réutilisé plus loin dans la chaîne avec une séquence spéciale ``\\number``, "
"décrite ci-dessous. Pour écrire des ``'('`` ou ``')'`` littéraux, utilisez "
"``\\(`` ou ``\\)``, ou enveloppez-les dans une classe de caractères : ``[(] "
"[)]``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:227
2016-10-30 09:46:26 +00:00
msgid "``(?...)``"
msgstr "``(?...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:223
2016-10-30 09:46:26 +00:00
msgid ""
"This is an extension notation (a ``'?'`` following a ``'('`` is not "
"meaningful otherwise). The first character after the ``'?'`` determines "
"what the meaning and further syntax of the construct is. Extensions usually "
"do not create a new group; ``(?P<name>...)`` is the only exception to this "
"rule. Following are the currently supported extensions."
msgstr ""
2017-05-27 14:30:14 +00:00
"Il s'agit d'une notation pour les extensions (un ``'?'`` suivant une ``'('`` "
"n'a pas de sens autrement). Le premier caractère après le ``'?'`` détermine "
"quel sens donner à l'expression. Les extensions ne créent généralement pas "
"de nouveaux groupes ; ``(?P<name>...)`` est la seule exception à la règle. "
"Retrouvez ci-dessous la liste des extensions actuellement supportées."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:240
2016-10-30 09:46:26 +00:00
msgid "``(?aiLmsux)``"
msgstr "``(?aiLmsux)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:230
2016-10-30 09:46:26 +00:00
msgid ""
"(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
"``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters "
"set the corresponding flags: :const:`re.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), and :const:`re.X` (verbose), for the "
"entire regular expression. (The flags are described in :ref:`contents-of-"
"module-re`.) This is useful if you wish to include the flags as part of the "
"regular expression, instead of passing a *flag* argument to the :func:`re."
"compile` function. Flags should be used first in the expression string."
msgstr ""
2017-05-27 14:30:14 +00:00
"(Une lettre ou plus de l'ensemble ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
"``'s'``, ``'u'``, ``'x'``.) Le groupe valide la chaîne vide ; les lettres "
"activent les modes correspondant : :const:`re.A` (validation *ASCII* "
"seulement), :const:`re.I` (ignorer la casse)`, :const:`re.L` (dépendant de "
"la locale), :const:`re.M` (multi-ligne), :const:`re.S` (les points "
"correspondent à tous les caractères) et :const:`re.X` (verbeux), pour "
"l'ensemble de l'expression rationnelle. (Les options dans décrites dans la "
"section :ref:`contents-of-module-re`.) C'est utile si vous souhaitez "
"préciser l'option dans l'expression rationnelle, plutôt qu'en passant un "
"argument *flag* à la fonction :func:`re.compile`. Les options devraient "
"être spécifiées en premier dans la chaîne de l'expression."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:246
2016-10-30 09:46:26 +00:00
msgid "``(?:...)``"
msgstr "``(?:...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:243
2016-10-30 09:46:26 +00:00
msgid ""
"A non-capturing version of regular parentheses. Matches whatever regular "
"expression is inside the parentheses, but the substring matched by the group "
"*cannot* be retrieved after performing a match or referenced later in the "
"pattern."
msgstr ""
2017-05-27 14:30:14 +00:00
"Une version non capturante des parenthèses habituelles. Valide n'importe "
"quelle expression rationnelle à l'intérieur des parenthèses, mais la sous-"
"chaîne correspondant au groupe *ne peut pas* être récupérée après l'analyse "
"ou être référencée plus loin dans le motif."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:256
2016-10-30 09:46:26 +00:00
msgid "``(?imsx-imsx:...)``"
2017-05-27 14:30:14 +00:00
msgstr "``(?imsx-imsx:...)``"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:249
2016-10-30 09:46:26 +00:00
msgid ""
"(Zero or more letters from the set ``'i'``, ``'m'``, ``'s'``, ``'x'``, "
"optionally followed by ``'-'`` followed by one or more letters from the same "
"set.) The letters set or removes the corresponding flags: :const:`re.I` "
"(ignore case), :const:`re.M` (multi-line), :const:`re.S` (dot matches all), "
"and :const:`re.X` (verbose), for the part of the expression. (The flags are "
"described in :ref:`contents-of-module-re`.)"
msgstr ""
2017-05-27 14:30:14 +00:00
"(Zéro lettres ou plus de l'ensemble ``'i'``, ``'m'``, ``'s'``, ``'x'``, "
"optionnellement suivies par ``'-'`` ainsi qu'une ou plusieurs lettres du "
"même ensemble.) Les lettres activent ou désactivent les options "
"correspondantes : :const:`re.I` (ignorer la casse), :const:`re.M` (multi-"
"ligne), :const:`re.S` (les points correspondent à tous les caractères) et :"
"const:`re.X` (verbeux), pour cette partie de l'expression. (Les options "
"sont décrites dans la section :ref:`contents-of-module-re`.)"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:281
2016-10-30 09:46:26 +00:00
msgid "``(?P<name>...)``"
msgstr "``(?P<name>...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:259
2016-10-30 09:46:26 +00:00
msgid ""
"Similar to regular parentheses, but the substring matched by the group is "
"accessible via the symbolic group name *name*. Group names must be valid "
"Python identifiers, and each group name must be defined only once within a "
"regular expression. A symbolic group is also a numbered group, just as if "
"the group were not named."
msgstr ""
2017-05-27 14:30:14 +00:00
"Similaires aux parenthèses habituelles, mais la sous-chaîne validée par le "
"groupe est accessible via le nom *name* du groupe symbolique. Les noms de "
"groupes doivent être des identifiants Python valides, et chaque nom de "
"groupe ne doit être défini qu'une seule fois dans une expression "
"rationnelle. Un groupe symbolique est aussi un groupe numéroté, de la même "
"manière que si le groupe n'était pas nommé."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:265
2016-10-30 09:46:26 +00:00
msgid ""
"Named groups can be referenced in three contexts. If the pattern is ``(?"
"P<quote>['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either "
"single or double quotes):"
msgstr ""
2017-05-27 14:30:14 +00:00
"Les groupes nommés peuvent être référencés dans trois contextes. Si le "
"motif est ``(?P<quote>['\"]).*?(?P=quote)`` (i.e. correspondant à une chaîne "
"entourée de guillemets simples ou doubles)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:270
2016-10-30 09:46:26 +00:00
msgid "Context of reference to group \"quote\""
2017-05-27 14:30:14 +00:00
msgstr "Contexte de référence au groupe \"quote\""
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:270
2016-10-30 09:46:26 +00:00
msgid "Ways to reference it"
2017-05-27 14:30:14 +00:00
msgstr "Manières de le référencer"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:272
2016-10-30 09:46:26 +00:00
msgid "in the same pattern itself"
2017-05-27 14:30:14 +00:00
msgstr "lui-même dans le même motif"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:272
2016-10-30 09:46:26 +00:00
msgid "``(?P=quote)`` (as shown)"
2017-05-27 14:30:14 +00:00
msgstr "``(?P=quote)`` (comme vu)"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:273 ../Doc/library/re.rst:280
2016-10-30 09:46:26 +00:00
msgid "``\\1``"
msgstr "``\\1``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:275
2016-10-30 09:46:26 +00:00
msgid "when processing match object ``m``"
2017-05-27 14:30:14 +00:00
msgstr "en analysant l'objet résultat ``m``"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:275
2016-10-30 09:46:26 +00:00
msgid "``m.group('quote')``"
msgstr "``m.group('quote')``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:276
2016-10-30 09:46:26 +00:00
msgid "``m.end('quote')`` (etc.)"
2017-05-27 14:30:14 +00:00
msgstr "``m.end('quote')`` (etc.)"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:278
2016-10-30 09:46:26 +00:00
msgid "in a string passed to the ``repl`` argument of ``re.sub()``"
2017-05-27 14:30:14 +00:00
msgstr "dans une chaîne passée à l'argument ``repl`` de ``re.sub()``"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:278
2016-10-30 09:46:26 +00:00
msgid "``\\g<quote>``"
msgstr "``\\g<quote>``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:279
2016-10-30 09:46:26 +00:00
msgid "``\\g<1>``"
msgstr "``\\g<1>``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:285
2016-10-30 09:46:26 +00:00
msgid "``(?P=name)``"
msgstr "``(?P=name)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:284
2016-10-30 09:46:26 +00:00
msgid ""
"A backreference to a named group; it matches whatever text was matched by "
"the earlier group named *name*."
msgstr ""
2017-05-27 14:30:14 +00:00
"Une référence arrière à un groupe nommé ; elle correspond à n'importe quel "
"texte validé plus tôt par le groupe nommé *name*."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:288
2016-10-30 09:46:26 +00:00
msgid "``(?#...)``"
msgstr "``(?#...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:288
2016-10-30 09:46:26 +00:00
msgid "A comment; the contents of the parentheses are simply ignored."
2017-05-27 14:30:14 +00:00
msgstr "Un commentaire ; le contenu des parenthèses est simplement ignoré."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:293
2016-10-30 09:46:26 +00:00
msgid "``(?=...)``"
msgstr "``(?=...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:291
2016-10-30 09:46:26 +00:00
msgid ""
"Matches if ``...`` matches next, but doesn't consume any of the string. "
"This is called a lookahead assertion. For example, ``Isaac (?=Asimov)`` "
"will match ``'Isaac '`` only if it's followed by ``'Asimov'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Valide si ``...`` valide la suite, mais ne consomme rien de la chaîne. On "
"appelle cela une assertion *lookahead*. Par exemple, ``Isaac (?=Asimov)`` "
"correspondra à la chaîne ``'Isaac'`` seulement si elle est suivie par "
"``'Asimov'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:298
2016-10-30 09:46:26 +00:00
msgid "``(?!...)``"
msgstr "``(?!...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:296
2016-10-30 09:46:26 +00:00
msgid ""
"Matches if ``...`` doesn't match next. This is a negative lookahead "
"assertion. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only if "
"it's *not* followed by ``'Asimov'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Valide si ``...`` ne valide pas la suite. C'est une assertion *lookahead* "
"négative. Par exemple, ``Isaac (?!Asimov)`` correspondra à la chaîne "
"``'Isaac'`` seulement si elle *n'est pas* suivie par ``'Asimov'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:323
2016-10-30 09:46:26 +00:00
msgid "``(?<=...)``"
msgstr "``(?<=...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:301
2016-10-30 09:46:26 +00:00
msgid ""
"Matches if the current position in the string is preceded by a match for "
"``...`` that ends at the current position. This is called a :dfn:`positive "
"lookbehind assertion`. ``(?<=abc)def`` will find a match in ``abcdef``, "
"since the lookbehind will back up 3 characters and check if the contained "
"pattern matches. The contained pattern must only match strings of some fixed "
"length, meaning that ``abc`` or ``a|b`` are allowed, but ``a*`` and ``a{3,4}"
"`` are not. Note that patterns which start with positive lookbehind "
"assertions will not match at the beginning of the string being searched; you "
"will most likely want to use the :func:`search` function rather than the :"
"func:`match` function:"
msgstr ""
2017-05-27 14:30:14 +00:00
"Valide si la position courante dans la chaîne est précédée par une "
"correspondance sur ``...`` qui se termine à la position courante. On "
"appelle cela une :dfn:`positive lookbehind assertion`. ``(?<=abc)def`` "
"cherchera une correspondance dans ``abcdef``, puisque le *lookbehind** "
"mettra de côté 3 caractères et vérifiera que le motif contenu correspond. "
"Le motif ne devra correspondre qu'à des chaînes de taille fixe, cela veut "
"dire que ``abc`` ou ``a|b` sont autorisées, mais pas ``a*`` ou ``a{3,4}``. "
"Notez que les motifs qui commencent par des assertions *lookbehind* "
"positives ne peuvent pas correspondre au début de la chaîne analysée ; vous "
"préférerez sûrement utiliser la fonction :func:`search` plutôt que la "
"fonction :func:`match` :"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:316
2016-10-30 09:46:26 +00:00
msgid "This example looks for a word following a hyphen:"
2017-05-27 14:30:14 +00:00
msgstr "Cet exemple recherche un mot suivi d'un trait d'union :"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:322
2016-10-30 09:46:26 +00:00
msgid "Added support for group references of fixed length."
2017-05-27 14:30:14 +00:00
msgstr "Ajout du support des références aux groupes de taille fixe."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:330
2016-10-30 09:46:26 +00:00
msgid "``(?<!...)``"
msgstr "``(?<!...)``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:326
2016-10-30 09:46:26 +00:00
msgid ""
"Matches if the current position in the string is not preceded by a match for "
"``...``. This is called a :dfn:`negative lookbehind assertion`. Similar to "
"positive lookbehind assertions, the contained pattern must only match "
"strings of some fixed length. Patterns which start with negative lookbehind "
"assertions may match at the beginning of the string being searched."
msgstr ""
2017-05-27 14:30:14 +00:00
"Valide si la position courante dans la chaîne n'est pas précédée par une "
"correspondance sur ``...``. On appelle cela une :dfn:`negative lookbehind "
"assertion`. À la manière des assertions *lookbehind* positives, le motif "
"contenu ne peut que correspondre à des chaînes de taille fixe. Les motifs "
"débutant par une assertion *lookbehind* négative peuvent correspondre au "
"début de la chaîne analysée."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:339
2016-10-30 09:46:26 +00:00
msgid "``(?(id/name)yes-pattern|no-pattern)``"
2017-05-27 14:30:14 +00:00
msgstr "``(?(id/name)yes-pattern|no-pattern)``"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:333
2016-10-30 09:46:26 +00:00
msgid ""
"Will try to match with ``yes-pattern`` if the group with given *id* or "
"*name* exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is "
"optional and can be omitted. For example, ``(<)?(\\w+@\\w+(?:\\.\\w+)+)(?"
"(1)>|$)`` is a poor email matching pattern, which will match with "
"``'<user@host.com>'`` as well as ``'user@host.com'``, but not with "
"``'<user@host.com'`` nor ``'user@host.com>'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Essaiera de faire la correspondance avec ``yes-pattern`` si le groupe "
"indiqué par *id* ou *name* existe, et avec ``no-pattern`` s'il n'existe pas. "
"``no-pattern`` est optionnel et peut être omis. Par exemple, ``(<)?(\\w+@\\w"
"+(?:\\.\\w+)+)(?(1)>|$)`` est un motif simpliste pour identifier une adresse "
"courriel, qui validera ``'<user@host.com>'`` ainsi que ``'user@host.com'`` "
"mais pas ``'<user@host.com'`` ni ``'user@host.com>'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:341
2016-10-30 09:46:26 +00:00
msgid ""
"The special sequences consist of ``'\\'`` and a character from the list "
"below. If the ordinary character is not an ASCII digit or an ASCII letter, "
"then the resulting RE will match the second character. For example, ``\\$`` "
"matches the character ``'$'``."
msgstr ""
2017-05-27 14:30:14 +00:00
"Les séquences spéciales sont composées de ``'\\'`` et d'un caractère de la "
"liste qui suit. Si le caractère ordinaire n'est pas un chiffre *ASCII* ou "
"une lettre *ASCII*, alors l'expression rationnelle résultante validera le "
"second caractère de la séquence. Par exemple, ``\\$`` correspond au "
"caractère ``'$'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:354
2016-10-30 09:46:26 +00:00
msgid "``\\number``"
msgstr "``\\number``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:347
2016-10-30 09:46:26 +00:00
msgid ""
"Matches the contents of the group of the same number. Groups are numbered "
"starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 "
"55'``, but not ``'thethe'`` (note the space after the group). This special "
"sequence can only be used to match one of the first 99 groups. If the first "
"digit of *number* is 0, or *number* is 3 octal digits long, it will not be "
"interpreted as a group match, but as the character with octal value "
"*number*. Inside the ``'['`` and ``']'`` of a character class, all numeric "
"escapes are treated as characters."
msgstr ""
2017-05-29 16:39:49 +00:00
"Correspond au contenu du groupe du même nombre. Les groupes sont numérotés à "
"partir de 1. Par exemple, ``(.+) \\1`` correspond à ``'the the'`` ou ``'55 "
"55'``, mais pas à ``'thethe'`` (notez l'espace après le groupe). Cette "
"séquence spéciale ne peut être utilisée que pour faire référence aux 99 "
"premiers groupes. Si le premier chiffre de *number* est 0, ou si *number* "
"est un nombre octal de 3 chiffres, il ne sera pas interprété comme une "
"référence à un groupe, mais comme le caractère à la valeur octale *number*. "
"À l'intérieur des ``'['`` et ``']'`` d'une classe de caractères, tous les "
"échappements numériques sont traités comme des caractères."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:357
2016-10-30 09:46:26 +00:00
msgid "``\\A``"
msgstr "``\\A``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:357
2016-10-30 09:46:26 +00:00
msgid "Matches only at the start of the string."
2017-05-29 16:39:49 +00:00
msgstr "Correspond uniquement au début d'une chaîne de caractères."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:372
2016-10-30 09:46:26 +00:00
msgid "``\\b``"
msgstr "``\\b``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:360
2016-10-30 09:46:26 +00:00
msgid ""
"Matches the empty string, but only at the beginning or end of a word. A word "
"is defined as a sequence of Unicode alphanumeric or underscore characters, "
"so the end of a word is indicated by whitespace or a non-alphanumeric, non-"
"underscore Unicode character. Note that formally, ``\\b`` is defined as the "
"boundary between a ``\\w`` and a ``\\W`` character (or vice versa), or "
"between ``\\w`` and the beginning/end of the string. This means that "
"``r'\\bfoo\\b'`` matches ``'foo'``, ``'foo.'``, ``'(foo)'``, ``'bar foo "
"baz'`` but not ``'foobar'`` or ``'foo3'``."
msgstr ""
2017-05-29 16:39:49 +00:00
"Correspond à la chaîne vide, mais uniquement au début ou à la fin d'un mot. "
"Un mot est défini comme une séquence de caractères Unicode alphanumériques "
"ou de tirets bas, la fin d'un mot est ainsi indiquée par une espace ou un "
"caractère qui n'est ni alphanumérique ni un tiret bas. Notez que "
"formellement, ``\\b`` est défini comme la liaison entre ``\\w`` et ``\\W`` "
"(et inversement), ou entre ``\\w`` et le début/fin d'un mot. Cela signifie "
"que ``r'\\bfoo\\b'`` validera ``'foo'``, ``'foo.'``, ``'(foo)'`` ou ``'bar "
"foo baz'`` mais pas ``'foobar'`` ou ``'foo3'``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:369
2016-10-30 09:46:26 +00:00
msgid ""
"By default Unicode alphanumerics are the ones used, but this can be changed "
"by using the :const:`ASCII` flag. Inside a character range, ``\\b`` "
"represents the backspace character, for compatibility with Python's string "
"literals."
msgstr ""
2017-05-29 16:39:49 +00:00
"Les caractères alphanumériques Unicode sont utilisés par défaut, mais cela "
"peut être changé en utilisant l'option :const:`ASCII`. À l'intérieur d'un "
"intervalle de caractères, ``\\b`` représente le caractère *backspace*, par "
"compatibilité avec les chaînes littérales Python."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:380
2016-10-30 09:46:26 +00:00
msgid "``\\B``"
msgstr "``\\B``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:375
2016-10-30 09:46:26 +00:00
msgid ""
"Matches the empty string, but only when it is *not* at the beginning or end "
"of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, "
"``'py2'``, but not ``'py'``, ``'py.'``, or ``'py!'``. ``\\B`` is just the "
"opposite of ``\\b``, so word characters are Unicode alphanumerics or the "
"underscore, although this can be changed by using the :const:`ASCII` flag."
msgstr ""
2017-05-29 16:39:49 +00:00
"Correspond à la chaîne vide, mais uniquement quand elle *n'est pas* au début "
"ou à la fin d'un mot. Cela signifie que ``r'py\\B'`` valide ``'python'``, "
"``'py3'`` ou ``'py2'``, mais pas ``'py'``, ``'py.'`` ou ``'py!'``. ``\\B`` "
"est simplement l'opposé de ``\\b``, donc les caractères de mots sont les "
"alphanumériques et tirets bas Unicode, bien que cela puisse être changé avec "
"l'option :const:`ASCII`."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:391
2016-10-30 09:46:26 +00:00
msgid "``\\d``"
msgstr "``\\d``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:388 ../Doc/library/re.rst:408
#: ../Doc/library/re.rst:427
2016-10-30 09:46:26 +00:00
msgid "For Unicode (str) patterns:"
2017-05-29 16:39:49 +00:00
msgstr "Pour les motifs Unicode (str) :"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:384
2016-10-30 09:46:26 +00:00
msgid ""
"Matches any Unicode decimal digit (that is, any character in Unicode "
"character category [Nd]). This includes ``[0-9]``, and also many other "
"digit characters. If the :const:`ASCII` flag is used only ``[0-9]`` is "
"matched (but the flag affects the entire regular expression, so in such "
"cases using an explicit ``[0-9]`` may be a better choice)."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide n'importe quel chiffre décimal Unicode (soit tout caractère Unicode "
"de catégorie [Nd]). Cela inclue ``[0-9]``, mais aussi bien d'autres "
"caractères de chiffres. Si l'option :const:`ASCII` est utilisée, seuls les "
"caractères de la classe ``[0-9]`` correspondront (mais l'option affectant "
"l'expression rationnelle entière, il peut être préférable dans ce genre de "
"cas d'utiliser un ``[0-9]`` explicite)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:391 ../Doc/library/re.rst:412
#: ../Doc/library/re.rst:431
2016-10-30 09:46:26 +00:00
msgid "For 8-bit (bytes) patterns:"
2017-05-29 16:39:49 +00:00
msgstr "Pour les motifs 8-bit (bytes) :"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:391
2016-10-30 09:46:26 +00:00
msgid "Matches any decimal digit; this is equivalent to ``[0-9]``."
2017-05-29 16:39:49 +00:00
msgstr "Valide n'importe quel chiffre décimal ; équivalent à ``[0-9]``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:398
2016-10-30 09:46:26 +00:00
msgid "``\\D``"
msgstr "``\\D``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:394
2016-10-30 09:46:26 +00:00
msgid ""
"Matches any character which is not a Unicode decimal digit. This is the "
"opposite of ``\\d``. If the :const:`ASCII` flag is used this becomes the "
"equivalent of ``[^0-9]`` (but the flag affects the entire regular "
"expression, so in such cases using an explicit ``[^0-9]`` may be a better "
"choice)."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide tout caractère qui n'est pas un chiffre décimal Unicode. C'est "
"l'opposé de ``\\d``. Si l'option :const:`ASCII` est utilisée, cela devient "
"équivalent à ``[^0-9]`` (mais l'option affectant l'expression rationnelle "
"entière, il peut être préférable dans ce genre de cas d'utiliser un "
"``[^0-9]`` explicite)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:412
2016-10-30 09:46:26 +00:00
msgid "``\\s``"
msgstr "``\\s``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:402
2016-10-30 09:46:26 +00:00
msgid ""
"Matches Unicode whitespace characters (which includes ``[ \\t\\n\\r\\f"
"\\v]``, and also many other characters, for example the non-breaking spaces "
"mandated by typography rules in many languages). If the :const:`ASCII` flag "
"is used, only ``[ \\t\\n\\r\\f\\v]`` is matched (but the flag affects the "
"entire regular expression, so in such cases using an explicit ``[ \\t\\n\\r"
"\\f\\v]`` may be a better choice)."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide les caractères d'espacement Unicode (qui incluent ``[ \\t\\n\\r\\f"
"\\v]`` et bien d'autres, comme les espaces insécables requises par les "
"règles typographiques de beaucoup de langues). Si l'option :const:`ASCII` "
"est utilisée, seuls les caractères de la classe ``[ \\t\\n\\r\\f\\v]`` sont "
"validés (mais l'option affectant l'expression rationnelle entière, il peut "
"être préférable dans ce genre de cas d'utiliser un ``[ \\t\\n\\r\\f\\v]`` "
"explicite)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:411
2016-10-30 09:46:26 +00:00
msgid ""
"Matches characters considered whitespace in the ASCII character set; this is "
"equivalent to ``[ \\t\\n\\r\\f\\v]``."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide les caractères considérés comme des espacements dans la table ASCII ; "
"équivalent à ``[ \\t\\n\\r\\f\\v]``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:419
2016-10-30 09:46:26 +00:00
msgid "``\\S``"
msgstr "``\\S``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:415
2016-10-30 09:46:26 +00:00
msgid ""
"Matches any character which is not a Unicode whitespace character. This is "
"the opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the "
"equivalent of ``[^ \\t\\n\\r\\f\\v]`` (but the flag affects the entire "
"regular expression, so in such cases using an explicit ``[^ \\t\\n\\r\\f"
"\\v]`` may be a better choice)."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide tout caractère qui n'est pas un caractère d'espacement Unicode. c'est "
"l'opposé de ``\\s``. Si l'option :const:`ASCII` est utilisée, cela devient "
"équivalent à ``[^ \\t\\n\\r\\f\\v]`` (mais l'option affectant l'expression "
"rationnelle entière, il peut être préférable dans ce genre de cas d'utiliser "
"un ``[^ \\t\\n\\r\\f\\v]`` explicite)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:431
2016-10-30 09:46:26 +00:00
msgid "``\\w``"
msgstr "``\\w``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:423
2016-10-30 09:46:26 +00:00
msgid ""
"Matches Unicode word characters; this includes most characters that can be "
"part of a word in any language, as well as numbers and the underscore. If "
"the :const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched (but the "
"flag affects the entire regular expression, so in such cases using an "
"explicit ``[a-zA-Z0-9_]`` may be a better choice)."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide les caractères Unicode de mot ; cela inclut la plupart des caractères "
"qui peuvent être compris dans un mot d'une quelconque langue, aussi bien que "
"les nombres et les tirets bas. Si l'option :const:`ASCII` est utilisée, "
"seuls les caractères de la classe ``[a-zA-Z0-9_]`` sont validés (mais "
"l'option affectant l'expression rationnelle entière, il peut être préférable "
"dans ce genre de cas d'utiliser un ``[a-zA-Z0-9_]`` explicite)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:430
2016-10-30 09:46:26 +00:00
msgid ""
"Matches characters considered alphanumeric in the ASCII character set; this "
"is equivalent to ``[a-zA-Z0-9_]``."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide les caractères alphanumériques de la table ASCII ; équivalent à ``[a-"
"zA-Z0-9_]``."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:438
2016-10-30 09:46:26 +00:00
msgid "``\\W``"
msgstr "``\\W``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:434
2016-10-30 09:46:26 +00:00
msgid ""
"Matches any character which is not a Unicode word character. This is the "
"opposite of ``\\w``. If the :const:`ASCII` flag is used this becomes the "
"equivalent of ``[^a-zA-Z0-9_]`` (but the flag affects the entire regular "
"expression, so in such cases using an explicit ``[^a-zA-Z0-9_]`` may be a "
"better choice)."
msgstr ""
2017-05-29 16:39:49 +00:00
"Valide tout caractère qui n'est pas un caractère Unicode de mot. C'est "
"l'opposé de ``\\w``. Si l'option :const:`ASCII` est utilisée, cela devient "
"équivalent à ``[^a-zA-Z0-9_]`` (mais l'option affectant l'expression "
"rationnelle entière, il peut être préférable dans ce genre de cas d'utiliser "
"un ``[^a-zA-Z0-9_]`` explicite)."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:441
2016-10-30 09:46:26 +00:00
msgid "``\\Z``"
msgstr "``\\Z``"
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:441
2016-10-30 09:46:26 +00:00
msgid "Matches only at the end of the string."
2017-05-29 16:39:49 +00:00
msgstr "Correspond uniquement à la fin d'une chaîne de caractères."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:443
2016-10-30 09:46:26 +00:00
msgid ""
"Most of the standard escapes supported by Python string literals are also "
"accepted by the regular expression parser::"
msgstr ""
2017-05-29 16:39:49 +00:00
"La plupart des échappements standards supportés par les chaînes littérales "
"sont aussi acceptés par le parseur d'expressions rationnelles: ::"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:450
2016-10-30 09:46:26 +00:00
msgid ""
"(Note that ``\\b`` is used to represent word boundaries, and means "
"\"backspace\" only inside character classes.)"
msgstr ""
2017-05-29 16:39:49 +00:00
"(Notez que ``\\b`` est utilisé pour représenter les bornes d'un mot, et "
"signifie « *backspace* » uniquement à l'intérieur d'une classe de "
"caractères.)"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:453
2016-10-30 09:46:26 +00:00
msgid ""
"``'\\u'`` and ``'\\U'`` escape sequences are only recognized in Unicode "
"patterns. In bytes patterns they are not treated specially."
msgstr ""
2017-05-29 16:39:49 +00:00
"Les séquences d'échappement ``'\\u'`` et ``'\\U'`` sont seulement reconnues "
"dans les motifs Unicode. Aucun traitement spécifique ne leur est porté dans "
"les motifs 8-bit."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:456
2016-10-30 09:46:26 +00:00
msgid ""
"Octal escapes are included in a limited form. If the first digit is a 0, or "
"if there are three octal digits, it is considered an octal escape. "
"Otherwise, it is a group reference. As for string literals, octal escapes "
"are always at most three digits in length."
msgstr ""
2017-05-29 16:39:49 +00:00
"Les séquences octales d'échappement sont inclues dans une forme limitée. Si "
"le premier chiffre est un 0, ou s'il y a trois chiffres octaux, la séquence "
"est considérée comme octale. Autrement, il s'agit d'une référence vers un "
"groupe. Comme pour les chaînes littérales, les séquences octales ne font "
"jamais plus de 3 caractères de long."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:461
2016-10-30 09:46:26 +00:00
msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added."
2017-05-29 16:39:49 +00:00
msgstr "Les séquences d'échappement ``'\\u'`` et ``'\\U'`` ont été ajoutées."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:464
2016-10-30 09:46:26 +00:00
msgid ""
"Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors."
msgstr ""
2017-05-29 16:39:49 +00:00
"Les séquences inconnues composées de ``'\\'`` et d'une lettre ASCII sont "
"maintenant des erreurs."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:472
2016-10-30 09:46:26 +00:00
msgid "Mastering Regular Expressions"
2017-05-29 16:39:49 +00:00
msgstr "Maîtriser les expression rationnelles"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:471
2016-10-30 09:46:26 +00:00
msgid ""
"Book on regular expressions by Jeffrey Friedl, published by O'Reilly. The "
"second edition of the book no longer covers Python at all, but the first "
"edition covered writing good regular expression patterns in great detail."
msgstr ""
2017-05-29 16:39:49 +00:00
"Livre sur les expressions rationnelles par Jeffrey Friedl, publié chez "
"OReilly. La seconde édition de ce livre ne couvre plus du tout Python, mais "
"la première version explique en détails comment écrire de bonnes expressions "
"rationnelles."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:480
2016-10-30 09:46:26 +00:00
msgid "Module Contents"
2017-05-29 16:39:49 +00:00
msgstr "Contenu du module"
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:482
2016-10-30 09:46:26 +00:00
msgid ""
"The module defines several functions, constants, and an exception. Some of "
"the functions are simplified versions of the full featured methods for "
"compiled regular expressions. Most non-trivial applications always use the "
"compiled form."
msgstr ""
2017-05-29 16:39:49 +00:00
"Le module définit plusieurs fonctions, constantes, et une exception. "
"Certaines fonctions sont des versions simplifiées des méthodes plus "
"complètes des expressions rationnelles compilées. La plupart des "
"applications non triviales utilisent toujours la version compilée."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:487
msgid ""
"Flag constants are now instances of :class:`RegexFlag`, which is a subclass "
"of :class:`enum.IntFlag`."
msgstr ""
2017-05-29 16:39:49 +00:00
"Les constantes d'options sont maintenant des instances de :class:"
"`RegexFlag`, sous-classe de :class:`enum.IntFlag`."
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:493
2016-10-30 09:46:26 +00:00
msgid ""
"Compile a regular expression pattern into a regular expression object, which "
"can be used for matching using its :func:`~regex.match` and :func:`~regex."
"search` methods, described below."
msgstr ""
2017-05-29 16:39:49 +00:00
"Compile un motif vers une expression rationnelle compilée, dont les "
"méthodes :func:`~regex.match` et :func:`~regex.search`, décrites ci-dessous, "
"peuvent être utilisées pour analyser des textes."
2016-10-30 09:46:26 +00:00
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:497
2016-10-30 09:46:26 +00:00
msgid ""
"The expression's behaviour can be modified by specifying a *flags* value. "
"Values can be any of the following variables, combined using bitwise OR (the "
"``|`` operator)."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:501
2016-10-30 09:46:26 +00:00
msgid "The sequence ::"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:506
2016-10-30 09:46:26 +00:00
msgid "is equivalent to ::"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:510
2016-10-30 09:46:26 +00:00
msgid ""
"but using :func:`re.compile` and saving the resulting regular expression "
"object for reuse is more efficient when the expression will be used several "
"times in a single program."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:516
2016-10-30 09:46:26 +00:00
msgid ""
"The compiled versions of the most recent patterns passed to :func:`re."
"compile` and the module-level matching functions are cached, so programs "
"that use only a few regular expressions at a time needn't worry about "
"compiling regular expressions."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:525
2016-10-30 09:46:26 +00:00
msgid ""
"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and ``"
"\\S`` perform ASCII-only matching instead of full Unicode matching. This is "
"only meaningful for Unicode patterns, and is ignored for byte patterns."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:529
2016-10-30 09:46:26 +00:00
msgid ""
"Note that for backward compatibility, the :const:`re.U` flag still exists "
"(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?"
"u)``), but these are redundant in Python 3 since matches are Unicode by "
"default for strings (and Unicode matching isn't allowed for bytes)."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:538
2016-10-30 09:46:26 +00:00
msgid "Display debug information about compiled expression."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:544
2016-10-30 09:46:26 +00:00
msgid ""
"Perform case-insensitive matching; expressions like ``[A-Z]`` will match "
"lowercase letters, too. This is not affected by the current locale and "
"works for Unicode characters as expected."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:552
2016-10-30 09:46:26 +00:00
msgid ""
"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` dependent on "
"the current locale. The use of this flag is discouraged as the locale "
"mechanism is very unreliable, and it only handles one \"culture\" at a time "
"anyway; you should use Unicode matching instead, which is the default in "
"Python 3 for Unicode (str) patterns. This flag can be used only with bytes "
"patterns."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:558
2016-10-30 09:46:26 +00:00
msgid ""
":const:`re.LOCALE` can be used only with bytes patterns and is not "
"compatible with :const:`re.ASCII`."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:566
2016-10-30 09:46:26 +00:00
msgid ""
"When specified, the pattern character ``'^'`` matches at the beginning of "
"the string and at the beginning of each line (immediately following each "
"newline); and the pattern character ``'$'`` matches at the end of the string "
"and at the end of each line (immediately preceding each newline). By "
"default, ``'^'`` matches only at the beginning of the string, and ``'$'`` "
"only at the end of the string and immediately before the newline (if any) at "
"the end of the string."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:577
2016-10-30 09:46:26 +00:00
msgid ""
"Make the ``'.'`` special character match any character at all, including a "
"newline; without this flag, ``'.'`` will match anything *except* a newline."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:584
2016-10-30 09:46:26 +00:00
msgid ""
"This flag allows you to write regular expressions that look nicer and are "
"more readable by allowing you to visually separate logical sections of the "
"pattern and add comments. Whitespace within the pattern is ignored, except "
"when in a character class or when preceded by an unescaped backslash. When a "
"line contains a ``#`` that is not in a character class and is not preceded "
"by an unescaped backslash, all characters from the leftmost such ``#`` "
"through the end of the line are ignored."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:592
2016-10-30 09:46:26 +00:00
msgid ""
"This means that the two following regular expression objects that match a "
"decimal number are functionally equal::"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:605
2016-10-30 09:46:26 +00:00
msgid ""
"Scan through *string* looking for the first location where the regular "
"expression *pattern* produces a match, and return a corresponding :ref:"
"`match object <match-objects>`. Return ``None`` if no position in the "
"string matches the pattern; note that this is different from finding a zero-"
"length match at some point in the string."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:614
2016-10-30 09:46:26 +00:00
msgid ""
"If zero or more characters at the beginning of *string* match the regular "
"expression *pattern*, return a corresponding :ref:`match object <match-"
"objects>`. Return ``None`` if the string does not match the pattern; note "
"that this is different from a zero-length match."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:619
2016-10-30 09:46:26 +00:00
msgid ""
"Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match "
"at the beginning of the string and not at the beginning of each line."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:622
2016-10-30 09:46:26 +00:00
msgid ""
"If you want to locate a match anywhere in *string*, use :func:`search` "
"instead (see also :ref:`search-vs-match`)."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:628
2016-10-30 09:46:26 +00:00
msgid ""
"If the whole *string* matches the regular expression *pattern*, return a "
"corresponding :ref:`match object <match-objects>`. Return ``None`` if the "
"string does not match the pattern; note that this is different from a zero-"
"length match."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:638
2016-10-30 09:46:26 +00:00
msgid ""
"Split *string* by the occurrences of *pattern*. If capturing parentheses "
"are used in *pattern*, then the text of all groups in the pattern are also "
"returned as part of the resulting list. If *maxsplit* is nonzero, at most "
"*maxsplit* splits occur, and the remainder of the string is returned as the "
"final element of the list. ::"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:653
2016-10-30 09:46:26 +00:00
msgid ""
"If there are capturing groups in the separator and it matches at the start "
"of the string, the result will start with an empty string. The same holds "
"for the end of the string:"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:660
2016-10-30 09:46:26 +00:00
msgid ""
"That way, separator components are always found at the same relative indices "
"within the result list."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:665
2016-10-30 09:46:26 +00:00
msgid ""
":func:`split` doesn't currently split a string on an empty pattern match. "
"For example:"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:671
2016-10-30 09:46:26 +00:00
msgid ""
"Even though ``'x*'`` also matches 0 'x' before 'a', between 'b' and 'c', and "
"after 'c', currently these matches are ignored. The correct behavior (i.e. "
"splitting on empty matches too and returning ``['', 'a', 'b', 'c', '']``) "
"will be implemented in future versions of Python, but since this is a "
"backward incompatible change, a :exc:`FutureWarning` will be raised in the "
"meanwhile."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:678
2016-10-30 09:46:26 +00:00
msgid ""
"Patterns that can only match empty strings currently never split the "
"string. Since this doesn't match the expected behavior, a :exc:`ValueError` "
"will be raised starting from Python 3.5::"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:688 ../Doc/library/re.rst:760
#: ../Doc/library/re.rst:780
2016-10-30 09:46:26 +00:00
msgid "Added the optional flags argument."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:691
2016-10-30 09:46:26 +00:00
msgid ""
"Splitting on a pattern that could match an empty string now raises a "
"warning. Patterns that can only match empty strings are now rejected."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:697
2016-10-30 09:46:26 +00:00
msgid ""
"Return all non-overlapping matches of *pattern* in *string*, as a list of "
"strings. The *string* is scanned left-to-right, and matches are returned in "
"the order found. If one or more groups are present in the pattern, return a "
"list of groups; this will be a list of tuples if the pattern has more than "
"one group. Empty matches are included in the result unless they touch the "
"beginning of another match."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:707
2016-10-30 09:46:26 +00:00
msgid ""
"Return an :term:`iterator` yielding :ref:`match objects <match-objects>` "
"over all non-overlapping matches for the RE *pattern* in *string*. The "
"*string* is scanned left-to-right, and matches are returned in the order "
"found. Empty matches are included in the result unless they touch the "
"beginning of another match."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:716
2016-10-30 09:46:26 +00:00
msgid ""
"Return the string obtained by replacing the leftmost non-overlapping "
"occurrences of *pattern* in *string* by the replacement *repl*. If the "
"pattern isn't found, *string* is returned unchanged. *repl* can be a string "
"or a function; if it is a string, any backslash escapes in it are "
"processed. That is, ``\\n`` is converted to a single newline character, ``"
"\\r`` is converted to a carriage return, and so forth. Unknown escapes such "
"as ``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced "
"with the substring matched by group 6 in the pattern. For example:"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:730
2016-10-30 09:46:26 +00:00
msgid ""
"If *repl* is a function, it is called for every non-overlapping occurrence "
"of *pattern*. The function takes a single match object argument, and "
"returns the replacement string. For example:"
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:742
2016-10-30 09:46:26 +00:00
msgid "The pattern may be a string or an RE object."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:744
2016-10-30 09:46:26 +00:00
msgid ""
"The optional argument *count* is the maximum number of pattern occurrences "
"to be replaced; *count* must be a non-negative integer. If omitted or zero, "
"all occurrences will be replaced. Empty matches for the pattern are replaced "
"only when not adjacent to a previous match, so ``sub('x*', '-', 'abc')`` "
"returns ``'-a-b-c-'``."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:750
2016-10-30 09:46:26 +00:00
msgid ""
"In string-type *repl* arguments, in addition to the character escapes and "
"backreferences described above, ``\\g<name>`` will use the substring matched "
"by the group named ``name``, as defined by the ``(?P<name>...)`` syntax. ``"
"\\g<number>`` uses the corresponding group number; ``\\g<2>`` is therefore "
"equivalent to ``\\2``, but isn't ambiguous in a replacement such as ``"
"\\g<2>0``. ``\\20`` would be interpreted as a reference to group 20, not a "
"reference to group 2 followed by the literal character ``'0'``. The "
"backreference ``\\g<0>`` substitutes in the entire substring matched by the "
"RE."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:763 ../Doc/library/re.rst:783
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:995
2016-10-30 09:46:26 +00:00
msgid "Unmatched groups are replaced with an empty string."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:766
msgid ""
"Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now "
"are errors."
msgstr ""
#: ../Doc/library/re.rst:772
msgid ""
"Deprecated since version 3.5, will be removed in version 3.7: Unknown "
"escapes in repl consisting of '\\' and an ASCII letter now raise a "
"deprecation warning and will be forbidden in Python 3.7."
msgstr ""
#: ../Doc/library/re.rst:772
msgid ""
"Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now "
"raise a deprecation warning and will be forbidden in Python 3.7."
msgstr ""
#: ../Doc/library/re.rst:777
2016-10-30 09:46:26 +00:00
msgid ""
"Perform the same operation as :func:`sub`, but return a tuple ``(new_string, "
"number_of_subs_made)``."
msgstr ""
2017-04-02 20:14:06 +00:00
#: ../Doc/library/re.rst:789
2016-10-30 09:46:26 +00:00
msgid ""
2017-05-27 17:46:38 +00:00
"Escape all the characters in *pattern* except ASCII letters, numbers and "
2016-10-30 09:46:26 +00:00
"``'_'``. This is useful if you want to match an arbitrary literal string "
2017-05-27 17:46:38 +00:00
"that may have regular expression metacharacters in it. For example::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:804
2016-10-30 09:46:26 +00:00
msgid "The ``'_'`` character is no longer escaped."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:810
2016-10-30 09:46:26 +00:00
msgid "Clear the regular expression cache."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:815
2016-10-30 09:46:26 +00:00
msgid ""
"Exception raised when a string passed to one of the functions here is not a "
"valid regular expression (for example, it might contain unmatched "
"parentheses) or when some other error occurs during compilation or "
"matching. It is never an error if a string contains no match for a "
"pattern. The error instance has the following additional attributes:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:823
2016-10-30 09:46:26 +00:00
msgid "The unformatted error message."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:827
2016-10-30 09:46:26 +00:00
msgid "The regular expression pattern."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:831
2016-10-30 09:46:26 +00:00
msgid "The index of *pattern* where compilation failed."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:835
2016-10-30 09:46:26 +00:00
msgid "The line corresponding to *pos*."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:839
2016-10-30 09:46:26 +00:00
msgid "The column corresponding to *pos*."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:841
2016-10-30 09:46:26 +00:00
msgid "Added additional attributes."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:847
2016-10-30 09:46:26 +00:00
msgid "Regular Expression Objects"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:849
2016-10-30 09:46:26 +00:00
msgid ""
"Compiled regular expression objects support the following methods and "
"attributes:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:854
2016-10-30 09:46:26 +00:00
msgid ""
"Scan through *string* looking for the first location where this regular "
"expression produces a match, and return a corresponding :ref:`match object "
"<match-objects>`. Return ``None`` if no position in the string matches the "
"pattern; note that this is different from finding a zero-length match at "
"some point in the string."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:860
2016-10-30 09:46:26 +00:00
msgid ""
"The optional second parameter *pos* gives an index in the string where the "
"search is to start; it defaults to ``0``. This is not completely equivalent "
"to slicing the string; the ``'^'`` pattern character matches at the real "
"beginning of the string and at positions just after a newline, but not "
"necessarily at the index where the search is to start."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:866
2016-10-30 09:46:26 +00:00
msgid ""
"The optional parameter *endpos* limits how far the string will be searched; "
"it will be as if the string is *endpos* characters long, so only the "
"characters from *pos* to ``endpos - 1`` will be searched for a match. If "
"*endpos* is less than *pos*, no match will be found; otherwise, if *rx* is a "
"compiled regular expression object, ``rx.search(string, 0, 50)`` is "
"equivalent to ``rx.search(string[:50], 0)``."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:881
2016-10-30 09:46:26 +00:00
msgid ""
"If zero or more characters at the *beginning* of *string* match this regular "
"expression, return a corresponding :ref:`match object <match-objects>`. "
"Return ``None`` if the string does not match the pattern; note that this is "
"different from a zero-length match."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:886 ../Doc/library/re.rst:904
2016-10-30 09:46:26 +00:00
msgid ""
"The optional *pos* and *endpos* parameters have the same meaning as for the :"
"meth:`~regex.search` method."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:894
2016-10-30 09:46:26 +00:00
msgid ""
"If you want to locate a match anywhere in *string*, use :meth:`~regex."
"search` instead (see also :ref:`search-vs-match`)."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:900
2016-10-30 09:46:26 +00:00
msgid ""
"If the whole *string* matches this regular expression, return a "
"corresponding :ref:`match object <match-objects>`. Return ``None`` if the "
"string does not match the pattern; note that this is different from a zero-"
"length match."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:918
2016-10-30 09:46:26 +00:00
msgid "Identical to the :func:`split` function, using the compiled pattern."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:923
2016-10-30 09:46:26 +00:00
msgid ""
"Similar to the :func:`findall` function, using the compiled pattern, but "
"also accepts optional *pos* and *endpos* parameters that limit the search "
"region like for :meth:`match`."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:930
2016-10-30 09:46:26 +00:00
msgid ""
"Similar to the :func:`finditer` function, using the compiled pattern, but "
"also accepts optional *pos* and *endpos* parameters that limit the search "
"region like for :meth:`match`."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:937
2016-10-30 09:46:26 +00:00
msgid "Identical to the :func:`sub` function, using the compiled pattern."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:942
2016-10-30 09:46:26 +00:00
msgid "Identical to the :func:`subn` function, using the compiled pattern."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:947
2016-10-30 09:46:26 +00:00
msgid ""
"The regex matching flags. This is a combination of the flags given to :func:"
"`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags "
"such as :data:`UNICODE` if the pattern is a Unicode string."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:954
2016-10-30 09:46:26 +00:00
msgid "The number of capturing groups in the pattern."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:959
2016-10-30 09:46:26 +00:00
msgid ""
"A dictionary mapping any symbolic group names defined by ``(?P<id>)`` to "
"group numbers. The dictionary is empty if no symbolic groups were used in "
"the pattern."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:966
2016-10-30 09:46:26 +00:00
msgid "The pattern string from which the RE object was compiled."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:972
2016-10-30 09:46:26 +00:00
msgid "Match Objects"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:974
2016-10-30 09:46:26 +00:00
msgid ""
"Match objects always have a boolean value of ``True``. Since :meth:`~regex."
"match` and :meth:`~regex.search` return ``None`` when there is no match, you "
"can test whether there was a match with a simple ``if`` statement::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:983
2016-10-30 09:46:26 +00:00
msgid "Match objects support the following methods and attributes:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:988
2016-10-30 09:46:26 +00:00
msgid ""
"Return the string obtained by doing backslash substitution on the template "
"string *template*, as done by the :meth:`~regex.sub` method. Escapes such as "
"``\\n`` are converted to the appropriate characters, and numeric "
"backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, ``"
"\\g<name>``) are replaced by the contents of the corresponding group."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1000
2016-10-30 09:46:26 +00:00
msgid ""
"Returns one or more subgroups of the match. If there is a single argument, "
"the result is a single string; if there are multiple arguments, the result "
"is a tuple with one item per argument. Without arguments, *group1* defaults "
"to zero (the whole match is returned). If a *groupN* argument is zero, the "
"corresponding return value is the entire matching string; if it is in the "
"inclusive range [1..99], it is the string matching the corresponding "
"parenthesized group. If a group number is negative or larger than the "
"number of groups defined in the pattern, an :exc:`IndexError` exception is "
"raised. If a group is contained in a part of the pattern that did not match, "
"the corresponding result is ``None``. If a group is contained in a part of "
"the pattern that matched multiple times, the last match is returned."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1022
2016-10-30 09:46:26 +00:00
msgid ""
"If the regular expression uses the ``(?P<name>...)`` syntax, the *groupN* "
"arguments may also be strings identifying groups by their group name. If a "
"string argument is not used as a group name in the pattern, an :exc:"
"`IndexError` exception is raised."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1027
2016-10-30 09:46:26 +00:00
msgid "A moderately complicated example:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1035
2016-10-30 09:46:26 +00:00
msgid "Named groups can also be referred to by their index:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1042
2016-10-30 09:46:26 +00:00
msgid "If a group matches multiple times, only the last match is accessible:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1051
2016-10-30 09:46:26 +00:00
msgid ""
"This is identical to ``m.group(g)``. This allows easier access to an "
"individual group from a match:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1067
2016-10-30 09:46:26 +00:00
msgid ""
"Return a tuple containing all the subgroups of the match, from 1 up to "
"however many groups are in the pattern. The *default* argument is used for "
"groups that did not participate in the match; it defaults to ``None``."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1071
2016-10-30 09:46:26 +00:00
msgid "For example:"
msgstr "Par exemple : ::"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1077
2016-10-30 09:46:26 +00:00
msgid ""
"If we make the decimal place and everything after it optional, not all "
"groups might participate in the match. These groups will default to "
"``None`` unless the *default* argument is given:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1090
2016-10-30 09:46:26 +00:00
msgid ""
"Return a dictionary containing all the *named* subgroups of the match, keyed "
"by the subgroup name. The *default* argument is used for groups that did "
"not participate in the match; it defaults to ``None``. For example:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1102
2016-10-30 09:46:26 +00:00
msgid ""
"Return the indices of the start and end of the substring matched by *group*; "
"*group* defaults to zero (meaning the whole matched substring). Return "
"``-1`` if *group* exists but did not contribute to the match. For a match "
"object *m*, and a group *g* that did contribute to the match, the substring "
"matched by group *g* (equivalent to ``m.group(g)``) is ::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1110
2016-10-30 09:46:26 +00:00
msgid ""
"Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched "
"a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m."
"start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are both "
"2, and ``m.start(2)`` raises an :exc:`IndexError` exception."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1115
2016-10-30 09:46:26 +00:00
msgid "An example that will remove *remove_this* from email addresses:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1125
2016-10-30 09:46:26 +00:00
msgid ""
"For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note "
"that if *group* did not contribute to the match, this is ``(-1, -1)``. "
"*group* defaults to zero, the entire match."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1132
2016-10-30 09:46:26 +00:00
msgid ""
"The value of *pos* which was passed to the :meth:`~regex.search` or :meth:"
"`~regex.match` method of a :ref:`regex object <re-objects>`. This is the "
"index into the string at which the RE engine started looking for a match."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1139
2016-10-30 09:46:26 +00:00
msgid ""
"The value of *endpos* which was passed to the :meth:`~regex.search` or :meth:"
"`~regex.match` method of a :ref:`regex object <re-objects>`. This is the "
"index into the string beyond which the RE engine will not go."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1146
2016-10-30 09:46:26 +00:00
msgid ""
"The integer index of the last matched capturing group, or ``None`` if no "
"group was matched at all. For example, the expressions ``(a)b``, ``((a)"
"(b))``, and ``((ab))`` will have ``lastindex == 1`` if applied to the string "
"``'ab'``, while the expression ``(a)(b)`` will have ``lastindex == 2``, if "
"applied to the same string."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1155
2016-10-30 09:46:26 +00:00
msgid ""
"The name of the last matched capturing group, or ``None`` if the group "
"didn't have a name, or if no group was matched at all."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1161
2016-10-30 09:46:26 +00:00
msgid ""
"The regular expression object whose :meth:`~regex.match` or :meth:`~regex."
"search` method produced this match instance."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1167
2016-10-30 09:46:26 +00:00
msgid "The string passed to :meth:`~regex.match` or :meth:`~regex.search`."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1173
2016-10-30 09:46:26 +00:00
msgid "Regular Expression Examples"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1177
2016-10-30 09:46:26 +00:00
msgid "Checking for a Pair"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1179
2016-10-30 09:46:26 +00:00
msgid ""
"In this example, we'll use the following helper function to display match "
"objects a little more gracefully:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1189
2016-10-30 09:46:26 +00:00
msgid ""
"Suppose you are writing a poker program where a player's hand is represented "
"as a 5-character string with each character representing a card, \"a\" for "
"ace, \"k\" for king, \"q\" for queen, \"j\" for jack, \"t\" for 10, and "
"\"2\" through \"9\" representing the card with that value."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1194
2016-10-30 09:46:26 +00:00
msgid "To see if a given string is a valid hand, one could do the following:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1204
2016-10-30 09:46:26 +00:00
msgid ""
"That last hand, ``\"727ak\"``, contained a pair, or two of the same valued "
"cards. To match this with a regular expression, one could use backreferences "
"as such:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1214
2016-10-30 09:46:26 +00:00
msgid ""
"To find out what card the pair consists of, one could use the :meth:`~match."
"group` method of the match object in the following manner:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1234
2016-10-30 09:46:26 +00:00
msgid "Simulating scanf()"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1238
2016-10-30 09:46:26 +00:00
msgid ""
"Python does not currently have an equivalent to :c:func:`scanf`. Regular "
"expressions are generally more powerful, though also more verbose, than :c:"
"func:`scanf` format strings. The table below offers some more-or-less "
"equivalent mappings between :c:func:`scanf` format tokens and regular "
"expressions."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1245
2016-10-30 09:46:26 +00:00
msgid ":c:func:`scanf` Token"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1245
2016-10-30 09:46:26 +00:00
msgid "Regular Expression"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1247
2016-10-30 09:46:26 +00:00
msgid "``%c``"
msgstr "``%c``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1247
2016-10-30 09:46:26 +00:00
msgid "``.``"
msgstr "``.``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1249
2016-10-30 09:46:26 +00:00
msgid "``%5c``"
msgstr "``%5c``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1249
2016-10-30 09:46:26 +00:00
msgid "``.{5}``"
msgstr "``.{5}``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1251
2016-10-30 09:46:26 +00:00
msgid "``%d``"
msgstr "``%d``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1251
2016-10-30 09:46:26 +00:00
msgid "``[-+]?\\d+``"
msgstr "``[-+]?\\d+``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1253
2016-10-30 09:46:26 +00:00
msgid "``%e``, ``%E``, ``%f``, ``%g``"
msgstr "``%e``, ``%E``, ``%f``, ``%g``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1253
2016-10-30 09:46:26 +00:00
msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``"
msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1255
2016-10-30 09:46:26 +00:00
msgid "``%i``"
msgstr "``%i``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1255
2016-10-30 09:46:26 +00:00
msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``"
msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1257
2016-10-30 09:46:26 +00:00
msgid "``%o``"
msgstr "``%o``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1257
2016-10-30 09:46:26 +00:00
msgid "``[-+]?[0-7]+``"
msgstr "``[-+]?[0-7]+``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1259
2016-10-30 09:46:26 +00:00
msgid "``%s``"
msgstr "``%s``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1259
2016-10-30 09:46:26 +00:00
msgid "``\\S+``"
msgstr "``\\S+``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1261
2016-10-30 09:46:26 +00:00
msgid "``%u``"
msgstr "``%u``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1261
2016-10-30 09:46:26 +00:00
msgid "``\\d+``"
msgstr "``\\d+``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1263
2016-10-30 09:46:26 +00:00
msgid "``%x``, ``%X``"
msgstr "``%x``, ``%X``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1263
2016-10-30 09:46:26 +00:00
msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``"
msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1266
2016-10-30 09:46:26 +00:00
msgid "To extract the filename and numbers from a string like ::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1270
2016-10-30 09:46:26 +00:00
msgid "you would use a :c:func:`scanf` format like ::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1274
2016-10-30 09:46:26 +00:00
msgid "The equivalent regular expression would be ::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1282
2016-10-30 09:46:26 +00:00
msgid "search() vs. match()"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1286
2016-10-30 09:46:26 +00:00
msgid ""
"Python offers two different primitive operations based on regular "
"expressions: :func:`re.match` checks for a match only at the beginning of "
"the string, while :func:`re.search` checks for a match anywhere in the "
"string (this is what Perl does by default)."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1291
2016-10-30 09:46:26 +00:00
msgid "For example::"
msgstr "Par exemple : ::"
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1297
2016-10-30 09:46:26 +00:00
msgid ""
"Regular expressions beginning with ``'^'`` can be used with :func:`search` "
"to restrict the match at the beginning of the string::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1305
2016-10-30 09:46:26 +00:00
msgid ""
"Note however that in :const:`MULTILINE` mode :func:`match` only matches at "
"the beginning of the string, whereas using :func:`search` with a regular "
"expression beginning with ``'^'`` will match at the beginning of each line."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1315
2016-10-30 09:46:26 +00:00
msgid "Making a Phonebook"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1317
2016-10-30 09:46:26 +00:00
msgid ""
":func:`split` splits a string into a list delimited by the passed pattern. "
"The method is invaluable for converting textual data into data structures "
"that can be easily read and modified by Python as demonstrated in the "
"following example that creates a phonebook."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1322
2016-10-30 09:46:26 +00:00
msgid ""
"First, here is the input. Normally it may come from a file, here we are "
"using triple-quoted string syntax:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1333
2016-10-30 09:46:26 +00:00
msgid ""
"The entries are separated by one or more newlines. Now we convert the string "
"into a list with each nonempty line having its own entry:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1346
2016-10-30 09:46:26 +00:00
msgid ""
"Finally, split each entry into a list with first name, last name, telephone "
"number, and address. We use the ``maxsplit`` parameter of :func:`split` "
"because the address has spaces, our splitting pattern, in it:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1359
2016-10-30 09:46:26 +00:00
msgid ""
"The ``:?`` pattern matches the colon after the last name, so that it does "
"not occur in the result list. With a ``maxsplit`` of ``4``, we could "
"separate the house number from the street name:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1374
2016-10-30 09:46:26 +00:00
msgid "Text Munging"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1376
2016-10-30 09:46:26 +00:00
msgid ""
":func:`sub` replaces every occurrence of a pattern with a string or the "
"result of a function. This example demonstrates using :func:`sub` with a "
"function to \"munge\" text, or randomize the order of all the characters in "
"each word of a sentence except for the first and last characters::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1393
2016-10-30 09:46:26 +00:00
msgid "Finding all Adverbs"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1395
2016-10-30 09:46:26 +00:00
msgid ""
":func:`findall` matches *all* occurrences of a pattern, not just the first "
"one as :func:`search` does. For example, if one was a writer and wanted to "
"find all of the adverbs in some text, he or she might use :func:`findall` in "
"the following manner:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1406
2016-10-30 09:46:26 +00:00
msgid "Finding all Adverbs and their Positions"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1408
2016-10-30 09:46:26 +00:00
msgid ""
"If one wants more information about all matches of a pattern than the "
"matched text, :func:`finditer` is useful as it provides :ref:`match objects "
"<match-objects>` instead of strings. Continuing with the previous example, "
"if one was a writer who wanted to find all of the adverbs *and their "
"positions* in some text, he or she would use :func:`finditer` in the "
"following manner:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1422
2016-10-30 09:46:26 +00:00
msgid "Raw String Notation"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1424
2016-10-30 09:46:26 +00:00
msgid ""
"Raw string notation (``r\"text\"``) keeps regular expressions sane. Without "
"it, every backslash (``'\\'``) in a regular expression would have to be "
"prefixed with another one to escape it. For example, the two following "
"lines of code are functionally identical:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1434
2016-10-30 09:46:26 +00:00
msgid ""
"When one wants to match a literal backslash, it must be escaped in the "
"regular expression. With raw string notation, this means ``r\"\\\\\"``. "
"Without raw string notation, one must use ``\"\\\\\\\\\"``, making the "
"following lines of code functionally identical:"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1446
2016-10-30 09:46:26 +00:00
msgid "Writing a Tokenizer"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1448
2016-10-30 09:46:26 +00:00
msgid ""
"A `tokenizer or scanner <https://en.wikipedia.org/wiki/Lexical_analysis>`_ "
"analyzes a string to categorize groups of characters. This is a useful "
"first step in writing a compiler or interpreter."
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1452
2016-10-30 09:46:26 +00:00
msgid ""
"The text categories are specified with regular expressions. The technique "
"is to combine those into a single master regular expression and to loop over "
"successive matches::"
msgstr ""
2017-05-27 17:46:38 +00:00
#: ../Doc/library/re.rst:1502
2016-10-30 09:46:26 +00:00
msgid "The tokenizer produces the following output::"
msgstr ""