Merge pull request #8 from entwanne/3.6

Complete library/re.po
This commit is contained in:
Julien 2017-06-02 09:13:51 +02:00 committed by GitHub
commit 4966cd5acc

View File

@ -414,7 +414,7 @@ msgstr ""
"vous que Python utilise aussi le *backslash* comme une séquence " "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 " "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 " "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 " "qui le suivent sont inclus dans la chaîne renvoyée. Cependant, si Python "
"avait reconnu la séquence, le *backslash* aurait dû être doublé. C'est " "avait reconnu la séquence, le *backslash* aurait dû être doublé. C'est "
"assez compliqué et difficile à comprendre, c'est pourquoi il est hautement " "assez compliqué et difficile à comprendre, c'est pourquoi il est hautement "
"recommandé d'utiliser des chaînes brutes pour tout sauf les expressions les " "recommandé d'utiliser des chaînes brutes pour tout sauf les expressions les "
@ -1208,7 +1208,7 @@ msgid ""
"times in a single program." "times in a single program."
msgstr "" msgstr ""
"mais utiliser :func:`re.compile` et sauvegarder l'expression rationnelle " "mais utiliser :func:`re.compile` et sauvegarder l'expression rationnelle "
"retournée pour la réutiliser est plus efficace quand l'expression est amenée " "renvoyée pour la réutiliser est plus efficace quand l'expression est amenée "
"à être utilisée plusieurs fois dans un même programme." "à être utilisée plusieurs fois dans un même programme."
#: ../Doc/library/re.rst:516 #: ../Doc/library/re.rst:516
@ -1346,8 +1346,8 @@ msgid ""
"length match at some point in the string." "length match at some point in the string."
msgstr "" msgstr ""
"Analyse *string* à la recherche du premier emplacement où l'expression " "Analyse *string* à la recherche du premier emplacement où l'expression "
"rationnelle *pattern* trouve une correspondance, et retourne le :ref:`match " "rationnelle *pattern* trouve une correspondance, et renvoie l':ref:`objet de "
"object <match-objects>` correspondant. Retourne ``None`` si aucune position " "correspondance <match-objects>` trouvé. Renvoie ``None`` si aucune position "
"dans la chaîne ne valide le motif ; notez que cela est différent de trouver " "dans la chaîne ne valide le motif ; notez que cela est différent de trouver "
"une correspondance avec une chaîne vide à un certain endroit de la chaîne." "une correspondance avec une chaîne vide à un certain endroit de la chaîne."
@ -1358,10 +1358,11 @@ msgid ""
"objects>`. Return ``None`` if the string does not match the pattern; note " "objects>`. Return ``None`` if the string does not match the pattern; note "
"that this is different from a zero-length match." "that this is different from a zero-length match."
msgstr "" msgstr ""
"Si zéro ou plus caractères au début de *string* correspondant à l'expression " "Si zéro ou plus caractères au début de *string* correspondent à l'expression "
"rationnelle *pattern*, retourne le :ref:`match object <match-objects>` " "rationnelle *pattern*, renvoie l':ref:`objet de correspondance <match-"
"correspondant. Retourne ``None`` si la chaîne ne correspond pas au motif ; " "objects>` trouvé. Renvoie ``None`` si la chaîne ne correspond pas au "
"notez que cela est différent d'une correspondance avec une chaîne vide." "motif ; notez que cela est différent d'une correspondance avec une chaîne "
"vide."
#: ../Doc/library/re.rst:619 #: ../Doc/library/re.rst:619
msgid "" msgid ""
@ -1376,6 +1377,8 @@ msgid ""
"If you want to locate a match anywhere in *string*, use :func:`search` " "If you want to locate a match anywhere in *string*, use :func:`search` "
"instead (see also :ref:`search-vs-match`)." "instead (see also :ref:`search-vs-match`)."
msgstr "" msgstr ""
"Si vous voulez trouver une correspondance n'importe où dans *string*, "
"utilisez plutôt :func:`search` (voir aussi :ref:`search-vs-match`)."
#: ../Doc/library/re.rst:628 #: ../Doc/library/re.rst:628
msgid "" msgid ""
@ -1384,6 +1387,10 @@ msgid ""
"string does not match the pattern; note that this is different from a zero-" "string does not match the pattern; note that this is different from a zero-"
"length match." "length match."
msgstr "" msgstr ""
"Si l'entièreté de la chaîne *string* correspond à l'expression rationnelle "
"*pattern*, renvoie l':ref:`objet de correspondance <match-objects>` trouvé. "
"Renvoie ``None`` si la chaîne ne correspond pas au motif ; notez que cela "
"est différent d'une correspondance avec une chaîne vide."
#: ../Doc/library/re.rst:638 #: ../Doc/library/re.rst:638
msgid "" msgid ""
@ -1393,6 +1400,12 @@ msgid ""
"*maxsplit* splits occur, and the remainder of the string is returned as the " "*maxsplit* splits occur, and the remainder of the string is returned as the "
"final element of the list. ::" "final element of the list. ::"
msgstr "" msgstr ""
"Sépare *string* selon les occurrences de *pattern*. Si des parenthèses "
"capturantes sont utilisées dans *pattern*, alors les textes des groupes du "
"motif sont aussi renvoyés comme éléments de la liste résultante. Si "
"*maxsplit* est différent de zéro, il ne pourra y avoir plus de *maxsplit* "
"séparations, et le reste de la chaîne sera renvoyé comme le dernier élément "
"de la liste. : ::"
#: ../Doc/library/re.rst:653 #: ../Doc/library/re.rst:653
msgid "" msgid ""
@ -1400,18 +1413,25 @@ msgid ""
"of the string, the result will start with an empty string. The same holds " "of the string, the result will start with an empty string. The same holds "
"for the end of the string:" "for the end of the string:"
msgstr "" msgstr ""
"S'il y a des groupes capturants dans le séparateur et qu'ils trouvent une "
"correspondance au début de la chaîne, le résultat commencera par une chaîne "
"vide. La même chose se produit pour la fin de la chaîne :"
#: ../Doc/library/re.rst:660 #: ../Doc/library/re.rst:660
msgid "" msgid ""
"That way, separator components are always found at the same relative indices " "That way, separator components are always found at the same relative indices "
"within the result list." "within the result list."
msgstr "" msgstr ""
"De cette manière, les séparateurs sont toujours trouvés aux mêmes indices "
"relatifs dans la liste résultante."
#: ../Doc/library/re.rst:665 #: ../Doc/library/re.rst:665
msgid "" msgid ""
":func:`split` doesn't currently split a string on an empty pattern match. " ":func:`split` doesn't currently split a string on an empty pattern match. "
"For example:" "For example:"
msgstr "" msgstr ""
":func:`split` ne sépare actuellement pas une chaîne sur une correspondance "
"vide. Par exemple :"
#: ../Doc/library/re.rst:671 #: ../Doc/library/re.rst:671
msgid "" msgid ""
@ -1422,6 +1442,12 @@ msgid ""
"backward incompatible change, a :exc:`FutureWarning` will be raised in the " "backward incompatible change, a :exc:`FutureWarning` will be raised in the "
"meanwhile." "meanwhile."
msgstr "" msgstr ""
"Même si ``'x*'`` correspond aussi à 0 'x' avant 'a', entre 'b' et 'c', et "
"après 'c', ces correspondances sont actuellement ignorées. Le comportement "
"correct (i.e. découper aussi sur les correspondances vides et renvoyer "
"``['', 'a', 'b', 'c', '']``) sera implémenté dans les futures versions de "
"Python, mais comme cela constitue un changement incompatible avec les "
"précédentes, une :exc:`FutureWarning` sera levée pendant la transition."
#: ../Doc/library/re.rst:678 #: ../Doc/library/re.rst:678
msgid "" msgid ""
@ -1429,17 +1455,24 @@ msgid ""
"string. Since this doesn't match the expected behavior, a :exc:`ValueError` " "string. Since this doesn't match the expected behavior, a :exc:`ValueError` "
"will be raised starting from Python 3.5::" "will be raised starting from Python 3.5::"
msgstr "" msgstr ""
"Les motifs qui ne peuvent correspondre qu'à des chaînes vides ne permettent "
"actuellement pas de découper la chaîne. Puisque cela ne correspond pas au "
"comportement voulu, une :exc:`ValueError` sera levée à partir de Python "
"3.5 : ::"
#: ../Doc/library/re.rst:688 ../Doc/library/re.rst:760 #: ../Doc/library/re.rst:688 ../Doc/library/re.rst:760
#: ../Doc/library/re.rst:780 #: ../Doc/library/re.rst:780
msgid "Added the optional flags argument." msgid "Added the optional flags argument."
msgstr "" msgstr "Ajout de l'argument optionnel *flags*"
#: ../Doc/library/re.rst:691 #: ../Doc/library/re.rst:691
msgid "" msgid ""
"Splitting on a pattern that could match an empty string now raises a " "Splitting on a pattern that could match an empty string now raises a "
"warning. Patterns that can only match empty strings are now rejected." "warning. Patterns that can only match empty strings are now rejected."
msgstr "" msgstr ""
"Découper sur un motif qui peut correspondre à une chaîne vide lève "
"maintenant un avertissement. Les motifs qui ne peuvent correspondre qu'à "
"des chaînes vides sont maintenant rejetés."
#: ../Doc/library/re.rst:697 #: ../Doc/library/re.rst:697
msgid "" msgid ""
@ -1450,6 +1483,14 @@ msgid ""
"one group. Empty matches are included in the result unless they touch the " "one group. Empty matches are included in the result unless they touch the "
"beginning of another match." "beginning of another match."
msgstr "" msgstr ""
"Renvoie toutes les correspondances de *pattern* dans *string* qui ne se "
"chevauchent pas, sous forme d'une liste de chaînes. Le chaîne *string* est "
"analysée de la gauche vers la droite, et les correspondances sont renvoyées "
"dans l'ordre où elles sont trouvées. Si un groupe ou plus sont présents "
"dans le motif, renvoie une liste de groupes ; il s'agira d'une liste de "
"*tuples* si le motif a plus d'un groupe. Les correspondances vides sont "
"inclues dans le résultat sauf si elles touchent le début d'une autre "
"correspondance."
#: ../Doc/library/re.rst:707 #: ../Doc/library/re.rst:707
msgid "" msgid ""
@ -1459,6 +1500,12 @@ msgid ""
"found. Empty matches are included in the result unless they touch the " "found. Empty matches are included in the result unless they touch the "
"beginning of another match." "beginning of another match."
msgstr "" msgstr ""
"Renvoie un :term:`iterator` produisant des :ref:`objets de correspondance "
"<match-objects>` pour toutes les correspondances non chevauchantes de "
"l'expression rationnelle *pattern* sur la chaîne *string*. *string* est "
"analysée de la gauche vers la droite, et les correspondances sont renvoyées "
"dans l'ordre où elles sont trouvées. Les correspondances vides sont inclues "
"dans le résultat sauf si elles touchent le début d'une autre correspondance."
#: ../Doc/library/re.rst:716 #: ../Doc/library/re.rst:716
msgid "" msgid ""
@ -1471,6 +1518,15 @@ msgid ""
"as ``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced " "as ``\\&`` are left alone. Backreferences, such as ``\\6``, are replaced "
"with the substring matched by group 6 in the pattern. For example:" "with the substring matched by group 6 in the pattern. For example:"
msgstr "" msgstr ""
"Renvoie la chaîne obtenue en remplaçant les occurrences (sans chevauchement) "
"les plus à gauche de *pattern* dans *string* par le remplacement *repl*. Si "
"le motif n'est pas trouvé, *string* est renvoyée inchangée. *repl* peut "
"être une chaîne de caractères ou une fonction ; si c'est une chaîne, toutes "
"les séquences d'échappement qu'elle contient sont traduites. Ainsi, ``\\n`` "
"est convertie en un simple saut de ligne, ``\r`` en un retour chariot, et "
"ainsi de suite. Les séquences inconnues telles que ``\\&`` sont laissées "
"intactes. Les références arrières, telles que ``\\6``, sont remplacées par "
"la sous-chaîne correspondant au groupe 6 dans le motif. Par exemple :"
#: ../Doc/library/re.rst:730 #: ../Doc/library/re.rst:730
msgid "" msgid ""
@ -1478,10 +1534,15 @@ msgid ""
"of *pattern*. The function takes a single match object argument, and " "of *pattern*. The function takes a single match object argument, and "
"returns the replacement string. For example:" "returns the replacement string. For example:"
msgstr "" msgstr ""
"Si *repl* est une fonction, elle est appelée pour chaque occurrence non "
"chevauchante de *pattern*. La fonction prend comme argument un objet de "
"correspondance, et renvoie la chaîne de remplacement. Par exemple :"
#: ../Doc/library/re.rst:742 #: ../Doc/library/re.rst:742
msgid "The pattern may be a string or an RE object." msgid "The pattern may be a string or an RE object."
msgstr "" msgstr ""
"Le motif peut être une chaîne de caractères ou un objet expression "
"rationnelle."
#: ../Doc/library/re.rst:744 #: ../Doc/library/re.rst:744
msgid "" msgid ""
@ -1491,6 +1552,12 @@ msgid ""
"only when not adjacent to a previous match, so ``sub('x*', '-', 'abc')`` " "only when not adjacent to a previous match, so ``sub('x*', '-', 'abc')`` "
"returns ``'-a-b-c-'``." "returns ``'-a-b-c-'``."
msgstr "" msgstr ""
"L'argument optionnel *count* est le nombre maximum d'occurrences du motif à "
"remplacer : *count* ne doit pas être un nombre négatif. Si omis ou nul, "
"toutes les occurrences seront remplacées. Les correspondances vides avec le "
"motif sont remplacées uniquement quand elles ne sont pas adjacentes à une "
"précédente correspondance, ainsi ``sub('x*', '-', 'abc')`` renvoie ``'-a-b-"
"c-'``."
#: ../Doc/library/re.rst:750 #: ../Doc/library/re.rst:750
msgid "" msgid ""
@ -1504,17 +1571,28 @@ msgid ""
"backreference ``\\g<0>`` substitutes in the entire substring matched by the " "backreference ``\\g<0>`` substitutes in the entire substring matched by the "
"RE." "RE."
msgstr "" msgstr ""
"Dans les arguments *repl* de type *string*, en plus des séquences "
"d'échappement et références arrières décrites au-dessus, ``\\g<name>`` "
"utilisera la sous-chaîne correspondant au groupe nommé ``name``, comme "
"défini par la syntaxe ``(?P<name>...)``. ``\\g<number>`` utilise le groupe "
"numéroté associé ; ``\\g<2>`` est ainsi équivalent à ``\\2``, mais n'est pas "
"ambigu dans un remplacement tel que ``\\g<2>0``, ``\\20`` serait interprété "
"comme une référence au groupe 20, et non une référence au groupe 2 suivie "
"par un caractère littéral ``'0'``. La référence arrière ``\\g<0>`` est "
"remplacée par la sous-chaîne entière validée par l'expression rationnelle."
#: ../Doc/library/re.rst:763 ../Doc/library/re.rst:783 #: ../Doc/library/re.rst:763 ../Doc/library/re.rst:783
#: ../Doc/library/re.rst:995 #: ../Doc/library/re.rst:995
msgid "Unmatched groups are replaced with an empty string." msgid "Unmatched groups are replaced with an empty string."
msgstr "" msgstr "Les groupes sans correspondance sont remplacés par une chaîne vide."
#: ../Doc/library/re.rst:766 #: ../Doc/library/re.rst:766
msgid "" msgid ""
"Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now "
"are errors." "are errors."
msgstr "" msgstr ""
"Les séquences d'échappement inconnues dans *pattern* formées par ``'\\'`` et "
"une lettre ASCII sont maintenant des erreurs."
#: ../Doc/library/re.rst:772 #: ../Doc/library/re.rst:772
msgid "" msgid ""
@ -1522,18 +1600,27 @@ msgid ""
"escapes in repl consisting of '\\' and an ASCII letter now raise a " "escapes in repl consisting of '\\' and an ASCII letter now raise a "
"deprecation warning and will be forbidden in Python 3.7." "deprecation warning and will be forbidden in Python 3.7."
msgstr "" msgstr ""
"Déprécié depuis la version 3.5, sera supprimé dans la 3.7 : Les séquences "
"d'échappement dans *repl* formées d'un '\\' et d'une lettre ASCII lèvent "
"maintenant un avertissement de dépréciation et seront interdites en Python "
"3.7."
#: ../Doc/library/re.rst:772 #: ../Doc/library/re.rst:772
msgid "" msgid ""
"Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now " "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now "
"raise a deprecation warning and will be forbidden in Python 3.7." "raise a deprecation warning and will be forbidden in Python 3.7."
msgstr "" msgstr ""
"Les séquences d'échappement dans *repl* formées d'un ``'\\'`` et d'une "
"lettre ASCII lèvent maintenant un avertissement de dépréciation et seront "
"interdites en Python 3.7."
#: ../Doc/library/re.rst:777 #: ../Doc/library/re.rst:777
msgid "" msgid ""
"Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, "
"number_of_subs_made)``." "number_of_subs_made)``."
msgstr "" msgstr ""
"Réalise la même opération que :func:`sub`, mais renvoie un *tuple* "
"``(nouvelle_chaîne, nombre_de_substitutions_réalisées)``."
#: ../Doc/library/re.rst:789 #: ../Doc/library/re.rst:789
msgid "" msgid ""
@ -1541,14 +1628,18 @@ msgid ""
"``'_'``. This is useful if you want to match an arbitrary literal string " "``'_'``. This is useful if you want to match an arbitrary literal string "
"that may have regular expression metacharacters in it. For example::" "that may have regular expression metacharacters in it. For example::"
msgstr "" msgstr ""
"Échappe tous les caractères de *pattern* à l'exception des lettres ASCII, "
"des nombres et de ``'_'``. Cela est utile si vous voulez valider une "
"quelconque chaîne littérale qui pourrait contenir des métacaractères "
"d'expressions rationnelles. Par exemple : ::"
#: ../Doc/library/re.rst:804 #: ../Doc/library/re.rst:804
msgid "The ``'_'`` character is no longer escaped." msgid "The ``'_'`` character is no longer escaped."
msgstr "" msgstr "Le caractère ``'_'`` n'est plus échappé."
#: ../Doc/library/re.rst:810 #: ../Doc/library/re.rst:810
msgid "Clear the regular expression cache." msgid "Clear the regular expression cache."
msgstr "" msgstr "Vide le cache d'expressions rationnelles."
#: ../Doc/library/re.rst:815 #: ../Doc/library/re.rst:815
msgid "" msgid ""
@ -1558,40 +1649,48 @@ msgid ""
"matching. It is never an error if a string contains no match for a " "matching. It is never an error if a string contains no match for a "
"pattern. The error instance has the following additional attributes:" "pattern. The error instance has the following additional attributes:"
msgstr "" msgstr ""
"Exception levée quand une chaîne passée à l'une des fonctions ici présentes "
"n'est pas une expression rationnelle valide (contenant par exemple une "
"parenthèse non fermée) ou quand d'autres erreurs se produisent durant la "
"compilation ou l'analyse. Il ne se produit jamais d'erreur si une chaîne ne "
"contient aucune correspondance pour un motif. Les instances de l'erreur ont "
"les attributs additionnels suivants :"
#: ../Doc/library/re.rst:823 #: ../Doc/library/re.rst:823
msgid "The unformatted error message." msgid "The unformatted error message."
msgstr "" msgstr "Le message d'erreur non formatté."
#: ../Doc/library/re.rst:827 #: ../Doc/library/re.rst:827
msgid "The regular expression pattern." msgid "The regular expression pattern."
msgstr "" msgstr "Le motif d'expression rationnelle."
#: ../Doc/library/re.rst:831 #: ../Doc/library/re.rst:831
msgid "The index of *pattern* where compilation failed." msgid "The index of *pattern* where compilation failed."
msgstr "" msgstr "L'index dans *pattern* où la compilation a échoué."
#: ../Doc/library/re.rst:835 #: ../Doc/library/re.rst:835
msgid "The line corresponding to *pos*." msgid "The line corresponding to *pos*."
msgstr "" msgstr "La ligne correspondant à *pos*."
#: ../Doc/library/re.rst:839 #: ../Doc/library/re.rst:839
msgid "The column corresponding to *pos*." msgid "The column corresponding to *pos*."
msgstr "" msgstr "La colonne correspondant à *pos*."
#: ../Doc/library/re.rst:841 #: ../Doc/library/re.rst:841
msgid "Added additional attributes." msgid "Added additional attributes."
msgstr "" msgstr "Ajout des attributs additionnels."
#: ../Doc/library/re.rst:847 #: ../Doc/library/re.rst:847
msgid "Regular Expression Objects" msgid "Regular Expression Objects"
msgstr "" msgstr "Objets d'expressions rationnelles"
#: ../Doc/library/re.rst:849 #: ../Doc/library/re.rst:849
msgid "" msgid ""
"Compiled regular expression objects support the following methods and " "Compiled regular expression objects support the following methods and "
"attributes:" "attributes:"
msgstr "" msgstr ""
"Les expressions rationnelles compilées supportent les méthodes et attributs "
"suivants :"
#: ../Doc/library/re.rst:854 #: ../Doc/library/re.rst:854
msgid "" msgid ""
@ -1601,6 +1700,11 @@ msgid ""
"pattern; note that this is different from finding a zero-length match at " "pattern; note that this is different from finding a zero-length match at "
"some point in the string." "some point in the string."
msgstr "" msgstr ""
"Analyse *string* à la recherche du premier emplacement où l'expression "
"rationnelle trouve une correspondance, et envoie l':ref:`objet de "
"correspondance <match-objects>` trouvé. Renvoie ``None`` si aucune position "
"dans la chaîne ne satisfait le motif ; notez que cela est différent que de "
"trouver une correspondance vide dans la chaîne."
#: ../Doc/library/re.rst:860 #: ../Doc/library/re.rst:860
msgid "" msgid ""
@ -1610,6 +1714,11 @@ msgid ""
"beginning of the string and at positions just after a newline, but not " "beginning of the string and at positions just after a newline, but not "
"necessarily at the index where the search is to start." "necessarily at the index where the search is to start."
msgstr "" msgstr ""
"Le second paramètre *pos* (optionnel) donne l'index dans la chaîne où la "
"recherche doit débuter ; il vaut ``0`` par défaut. Cela n'est pas "
"complètement équivalent à un *slicing* sur la chaîne ; le caractère de motif "
"``'^'`` correspond au début réel de la chaîne et aux positions juste après "
"un saut de ligne, mais pas nécessairement à l'index où la recherche commence."
#: ../Doc/library/re.rst:866 #: ../Doc/library/re.rst:866
msgid "" msgid ""
@ -1620,6 +1729,13 @@ msgid ""
"compiled regular expression object, ``rx.search(string, 0, 50)`` is " "compiled regular expression object, ``rx.search(string, 0, 50)`` is "
"equivalent to ``rx.search(string[:50], 0)``." "equivalent to ``rx.search(string[:50], 0)``."
msgstr "" msgstr ""
"Le paramètre optionnel *endpos* limite la longueur sur laquelle la chaîne "
"sera analysée ; ce sera comme si la chaîne faisait *endpos* caractères de "
"long, donc uniquement les caractères de *pos* à ``endpos - 1`` seront "
"analysés pour trouver une correspondance. Si *endpos* est inférieur à "
"*pos*, aucune correspondance ne sera trouvée ; dit autrement, avec *rx* une "
"expression rationnelle compilée, ``rx.search(string, 0, 50)`` est équivalent "
"à ``rx.search(string[:50], 0)``."
#: ../Doc/library/re.rst:881 #: ../Doc/library/re.rst:881
msgid "" msgid ""
@ -1628,18 +1744,26 @@ msgid ""
"Return ``None`` if the string does not match the pattern; note that this is " "Return ``None`` if the string does not match the pattern; note that this is "
"different from a zero-length match." "different from a zero-length match."
msgstr "" msgstr ""
"Si zéro caractère ou plus au début de *string* correspondent à cette "
"expression rationnelle, renvoie l':ref:`objet de correspondance <match-"
"objects>` trouvé. Renvoie ``None`` si la chaîne ne correspond pas au motif ; "
"notez que cela est différent d'une correspondance vide."
#: ../Doc/library/re.rst:886 ../Doc/library/re.rst:904 #: ../Doc/library/re.rst:886 ../Doc/library/re.rst:904
msgid "" msgid ""
"The optional *pos* and *endpos* parameters have the same meaning as for the :" "The optional *pos* and *endpos* parameters have the same meaning as for the :"
"meth:`~regex.search` method." "meth:`~regex.search` method."
msgstr "" msgstr ""
"Les paramètres optionnels *pos* et *endpos* ont le même sens que pour la "
"méthode :meth:`~regex.search`."
#: ../Doc/library/re.rst:894 #: ../Doc/library/re.rst:894
msgid "" msgid ""
"If you want to locate a match anywhere in *string*, use :meth:`~regex." "If you want to locate a match anywhere in *string*, use :meth:`~regex."
"search` instead (see also :ref:`search-vs-match`)." "search` instead (see also :ref:`search-vs-match`)."
msgstr "" msgstr ""
"Si vous voulez une recherche n'importe où dans *string*, utilisez plutôt :"
"meth:`~regex.search` (voir aussi :ref:`search-vs-match`)."
#: ../Doc/library/re.rst:900 #: ../Doc/library/re.rst:900
msgid "" msgid ""
@ -1648,10 +1772,14 @@ msgid ""
"string does not match the pattern; note that this is different from a zero-" "string does not match the pattern; note that this is different from a zero-"
"length match." "length match."
msgstr "" msgstr ""
"Si la chaîne *string* entière valide l'expression rationnelle, renvoie l':"
"ref:`object de correspondance <match-object>` associé. Renvoie ``None`` si "
"la chaîne ne correspond pas au motif ; notez que cela est différent d'une "
"correspondance vide."
#: ../Doc/library/re.rst:918 #: ../Doc/library/re.rst:918
msgid "Identical to the :func:`split` function, using the compiled pattern." msgid "Identical to the :func:`split` function, using the compiled pattern."
msgstr "" msgstr "Identique à la fonction :func:`split`, en utilisant le motif compilé."
#: ../Doc/library/re.rst:923 #: ../Doc/library/re.rst:923
msgid "" msgid ""
@ -1659,6 +1787,9 @@ msgid ""
"also accepts optional *pos* and *endpos* parameters that limit the search " "also accepts optional *pos* and *endpos* parameters that limit the search "
"region like for :meth:`match`." "region like for :meth:`match`."
msgstr "" msgstr ""
"Similaire à la fonction :func:`findall`, en utilisant le motif compilé, mais "
"accepte aussi des paramètres *pos* et *endpos* optionnels qui limitent la "
"région de recherche comme pour :meth:`match`."
#: ../Doc/library/re.rst:930 #: ../Doc/library/re.rst:930
msgid "" msgid ""
@ -1666,14 +1797,17 @@ msgid ""
"also accepts optional *pos* and *endpos* parameters that limit the search " "also accepts optional *pos* and *endpos* parameters that limit the search "
"region like for :meth:`match`." "region like for :meth:`match`."
msgstr "" msgstr ""
"Similaire à la fonction :func:`finditer`, en utilisant le motif compilé, "
"mais accepte aussi des paramètres *pos* et *endpos* optionnels qui limitent "
"la région de recherche comme pour :meth:`match`."
#: ../Doc/library/re.rst:937 #: ../Doc/library/re.rst:937
msgid "Identical to the :func:`sub` function, using the compiled pattern." msgid "Identical to the :func:`sub` function, using the compiled pattern."
msgstr "" msgstr "Identique à la fonction :func:`sub`, en utilisant le motif compilé."
#: ../Doc/library/re.rst:942 #: ../Doc/library/re.rst:942
msgid "Identical to the :func:`subn` function, using the compiled pattern." msgid "Identical to the :func:`subn` function, using the compiled pattern."
msgstr "" msgstr "Identique à la fonction :func:`subn`, en utilisant le motif compilé."
#: ../Doc/library/re.rst:947 #: ../Doc/library/re.rst:947
msgid "" msgid ""
@ -1681,10 +1815,14 @@ msgid ""
"`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags "
"such as :data:`UNICODE` if the pattern is a Unicode string." "such as :data:`UNICODE` if the pattern is a Unicode string."
msgstr "" msgstr ""
"Les options de validation de l'expression rationnelle. Il s'agit d'une "
"combinaison des options données à :func:`compile`, des potentielles options "
"``(?...)`` dans le motif, et des options implicites comme :data:`UNICODE` si "
"le motif est une chaîne Unicode."
#: ../Doc/library/re.rst:954 #: ../Doc/library/re.rst:954
msgid "The number of capturing groups in the pattern." msgid "The number of capturing groups in the pattern."
msgstr "" msgstr "Le nombre de groupes capturants dans le motif."
#: ../Doc/library/re.rst:959 #: ../Doc/library/re.rst:959
msgid "" msgid ""
@ -1692,14 +1830,19 @@ msgid ""
"group numbers. The dictionary is empty if no symbolic groups were used in " "group numbers. The dictionary is empty if no symbolic groups were used in "
"the pattern." "the pattern."
msgstr "" msgstr ""
"Un dictionnaire associant les noms de groupes symboliques définis par ``(?"
"P<id>)`` aux groupes numérotés. Le dictionnaire est vide si aucun groupe "
"symbolique n'est utilisé dans le motif."
#: ../Doc/library/re.rst:966 #: ../Doc/library/re.rst:966
msgid "The pattern string from which the RE object was compiled." msgid "The pattern string from which the RE object was compiled."
msgstr "" msgstr ""
"La chaîne de motif depuis laquelle l'objet expression rationnelle a été "
"compilé."
#: ../Doc/library/re.rst:972 #: ../Doc/library/re.rst:972
msgid "Match Objects" msgid "Match Objects"
msgstr "" msgstr "Objets de correspondance"
#: ../Doc/library/re.rst:974 #: ../Doc/library/re.rst:974
msgid "" msgid ""
@ -1707,10 +1850,15 @@ msgid ""
"match` and :meth:`~regex.search` return ``None`` when there is no match, you " "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::" "can test whether there was a match with a simple ``if`` statement::"
msgstr "" msgstr ""
"Les objets de correspondance ont toujours une valeur booléenne ``True``. "
"Puisque :meth:`~regex.match` et :meth:`~regex.search` renvoient ``None`` "
"quand il n'y a pas de correspondance, vous pouvez tester s'il y a eu "
"correspondance avec une simple instruction ``if`` : ::"
#: ../Doc/library/re.rst:983 #: ../Doc/library/re.rst:983
msgid "Match objects support the following methods and attributes:" msgid "Match objects support the following methods and attributes:"
msgstr "" msgstr ""
"Les objets de correspondance supportent les méthodes et attributs suivants :"
#: ../Doc/library/re.rst:988 #: ../Doc/library/re.rst:988
msgid "" msgid ""
@ -1720,6 +1868,12 @@ msgid ""
"backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, ``" "backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, ``"
"\\g<name>``) are replaced by the contents of the corresponding group." "\\g<name>``) are replaced by the contents of the corresponding group."
msgstr "" msgstr ""
"Renvoie la chaîne obtenue en substituant les séquences d'échappement du "
"gabarit *template*, comme réalisé par la méthode :meth:`~regex.sub`. Les "
"séquences comme ``\\n`` sont converties vers les caractères appropriés, et "
"les références arrières numériques (``\\1``, ``\\2``) et nommées (``"
"\\g<1>``, ``\\g<name>``) sont remplacées par les contenus des groupes "
"correspondant."
#: ../Doc/library/re.rst:1000 #: ../Doc/library/re.rst:1000
msgid "" msgid ""
@ -1735,6 +1889,18 @@ msgid ""
"the corresponding result is ``None``. If a group is contained in a part of " "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." "the pattern that matched multiple times, the last match is returned."
msgstr "" msgstr ""
"Renvoie un ou plus sous-groupes de la correspondance. Si un seul argument "
"est donné, le résultat est une chaîne simple ; s'il y a plusieurs arguments, "
"le résultat est un *tuple* comprenant un élément par argument. Sans "
"arguments, *group1* vaut par défaut zéro (la correspondance entière est "
"renvoyée). Si un argument *groupN* vaut zéro, l'élément associé sera la "
"chaîne de correspondance entière ; s'il est dans l'intervalle fermé [1..99], "
"c'est la correspondance avec le groupe de parenthèses associé. Si un numéro "
"de groupe est négatif ou supérieur au nombre de groupes définis dans le "
"motif, une exception :exc:`indexError` est levée. Si un groupe est contenu "
"dans une partie du motif qui n'a aucune correspondance, l'élément associé "
"sera ``None``. Si un groupe est contenu dans une partie du motif qui a "
"plusieurs correspondances, seule la dernière correspondance est renvoyée."
#: ../Doc/library/re.rst:1022 #: ../Doc/library/re.rst:1022
msgid "" msgid ""
@ -1743,24 +1909,31 @@ msgid ""
"string argument is not used as a group name in the pattern, an :exc:" "string argument is not used as a group name in the pattern, an :exc:"
"`IndexError` exception is raised." "`IndexError` exception is raised."
msgstr "" msgstr ""
"Si l'expression rationnelle utilise la syntaxe ``(?P<name>...)``, les "
"arguments *groupN* peuvent alors aussi être des chaînes identifiant les "
"groupes par leurs noms. Si une chaîne donnée en argument n'est pas utilisée "
"comme nom de groupe dans le motif, une exception :exc:`IndexError` est levée."
#: ../Doc/library/re.rst:1027 #: ../Doc/library/re.rst:1027
msgid "A moderately complicated example:" msgid "A moderately complicated example:"
msgstr "" msgstr "Un exemple modérément compliqué :"
#: ../Doc/library/re.rst:1035 #: ../Doc/library/re.rst:1035
msgid "Named groups can also be referred to by their index:" msgid "Named groups can also be referred to by their index:"
msgstr "" msgstr "Les groupes nommés peuvent aussi être référencés par leur index :"
#: ../Doc/library/re.rst:1042 #: ../Doc/library/re.rst:1042
msgid "If a group matches multiple times, only the last match is accessible:" msgid "If a group matches multiple times, only the last match is accessible:"
msgstr "" msgstr ""
"Si un groupe a plusieurs correspondances, seule la dernière est accessible :"
#: ../Doc/library/re.rst:1051 #: ../Doc/library/re.rst:1051
msgid "" msgid ""
"This is identical to ``m.group(g)``. This allows easier access to an " "This is identical to ``m.group(g)``. This allows easier access to an "
"individual group from a match:" "individual group from a match:"
msgstr "" msgstr ""
"Cela est identique à ``m.group(g)``. Cela permet un accès plus facile à un "
"groupe individuel depuis une correspondance :"
#: ../Doc/library/re.rst:1067 #: ../Doc/library/re.rst:1067
msgid "" msgid ""
@ -1768,6 +1941,9 @@ msgid ""
"however many groups are in the pattern. The *default* argument is used for " "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``." "groups that did not participate in the match; it defaults to ``None``."
msgstr "" msgstr ""
"Renvoie un *tuple* contenant tous les sous-groupes de la correspondance, de "
"1 jusqu'au nombre de groupes dans le motif. L'argument *default* est "
"utilisé pour les groupes sans correspondance ; il vaut ``None`` par défaut."
#: ../Doc/library/re.rst:1071 #: ../Doc/library/re.rst:1071
msgid "For example:" msgid "For example:"
@ -1779,6 +1955,10 @@ msgid ""
"groups might participate in the match. These groups will default to " "groups might participate in the match. These groups will default to "
"``None`` unless the *default* argument is given:" "``None`` unless the *default* argument is given:"
msgstr "" msgstr ""
"Si on rend la partie décimale et tout ce qui la suit optionnels, tous les "
"groupes ne figureront pas dans la correspondance. Ces groupes sans "
"correspondance vaudront ``None`` sauf si une autre valeur est donnée à "
"l'argument *default* :"
#: ../Doc/library/re.rst:1090 #: ../Doc/library/re.rst:1090
msgid "" msgid ""
@ -1786,6 +1966,10 @@ msgid ""
"by the subgroup name. The *default* argument is used for groups that did " "by the subgroup name. The *default* argument is used for groups that did "
"not participate in the match; it defaults to ``None``. For example:" "not participate in the match; it defaults to ``None``. For example:"
msgstr "" msgstr ""
"Renvoie un dictionnaire contenant tous les sous-groupes *nommés* de la "
"correspondance, accessibles par leurs noms. L'argument *default* est "
"utilisé pour les groupes qui ne figurent pas dans la correspondance ; il "
"vaut ``None`` par défaut. Par exemple :"
#: ../Doc/library/re.rst:1102 #: ../Doc/library/re.rst:1102
msgid "" msgid ""
@ -1795,6 +1979,12 @@ msgid ""
"object *m*, and a group *g* that did contribute to the match, the substring " "object *m*, and a group *g* that did contribute to the match, the substring "
"matched by group *g* (equivalent to ``m.group(g)``) is ::" "matched by group *g* (equivalent to ``m.group(g)``) is ::"
msgstr "" msgstr ""
"Renvoie les indices de début et de fin de la sous-chaîne correspondant au "
"groupe *group* ; *group* vaut par défaut zéro (pour récupérer les indices de "
"la correspondance complète). Renvoie ``-1`` si *group* existe mais ne figure "
"pas dans la correspondance. Pour un objet de correspondance *m*, et un "
"groupe *g* qui y figure, la sous-chaîne correspondant au groupe *g* "
"(équivalente à ``m.group(g)``) est : ::"
#: ../Doc/library/re.rst:1110 #: ../Doc/library/re.rst:1110
msgid "" msgid ""
@ -1803,10 +1993,15 @@ msgid ""
"start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are both " "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." "2, and ``m.start(2)`` raises an :exc:`IndexError` exception."
msgstr "" msgstr ""
"Notez que ``m.start(group)`` sera égal à ``m.end(group)`` si *group* "
"correspond à une chaîne vide. Par exemple, après ``m = re.search('b(c?)', "
"'cba')``, ``m.start(0)`` vaut 1, ``m.end(0)`` vaut 2, ``m.start(1)`` et ``m."
"end(1)`` valent tous deux 2, et ``m.start(2)`` lève une exception :exc:"
"`IndexError`."
#: ../Doc/library/re.rst:1115 #: ../Doc/library/re.rst:1115
msgid "An example that will remove *remove_this* from email addresses:" msgid "An example that will remove *remove_this* from email addresses:"
msgstr "" msgstr "Un exemple qui supprimera *remove_this* d'une adresse email :"
#: ../Doc/library/re.rst:1125 #: ../Doc/library/re.rst:1125
msgid "" msgid ""
@ -1814,6 +2009,10 @@ msgid ""
"that if *group* did not contribute to the match, this is ``(-1, -1)``. " "that if *group* did not contribute to the match, this is ``(-1, -1)``. "
"*group* defaults to zero, the entire match." "*group* defaults to zero, the entire match."
msgstr "" msgstr ""
"Pour un objet de correspondance *m*, renvoie le *tuple* ``(m.start(group), m."
"end(group))``. Notez que si *group* ne figure pas dans la correspondance, "
"``(-1, -1)`` est renvoyé. *group* vaut par défaut zéro, pour la "
"correspondance entière."
#: ../Doc/library/re.rst:1132 #: ../Doc/library/re.rst:1132
msgid "" msgid ""
@ -1821,6 +2020,10 @@ msgid ""
"`~regex.match` method of a :ref:`regex object <re-objects>`. This is the " "`~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." "index into the string at which the RE engine started looking for a match."
msgstr "" msgstr ""
"La valeur de *pos* qui a été passée à la méthode :meth:`~regex.search` ou :"
"meth:`~regex.match` d'un :ref:`objet expression rationnelle <re-objects>`. "
"C'est l'index dans la chaîne à partir duquel le moteur d'expressions "
"rationnelles recherche une correspondance."
#: ../Doc/library/re.rst:1139 #: ../Doc/library/re.rst:1139
msgid "" msgid ""
@ -1828,6 +2031,10 @@ msgid ""
"`~regex.match` method of a :ref:`regex object <re-objects>`. This is the " "`~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." "index into the string beyond which the RE engine will not go."
msgstr "" msgstr ""
"La valeur de *endpos* qui a été passée à la méthode :meth:`~regex.search` "
"ou :meth:`~regex.match` d'un :ref:`objet expression rationnelle <re-"
"objects>`. C'est l'index dans la chaîne que le moteur d'expressions "
"rationnelles ne dépassera pas."
#: ../Doc/library/re.rst:1146 #: ../Doc/library/re.rst:1146
msgid "" msgid ""
@ -1837,36 +2044,47 @@ msgid ""
"``'ab'``, while the expression ``(a)(b)`` will have ``lastindex == 2``, if " "``'ab'``, while the expression ``(a)(b)`` will have ``lastindex == 2``, if "
"applied to the same string." "applied to the same string."
msgstr "" msgstr ""
"L'index entier du dernier groupe de capture validé, ou ``None`` si aucun "
"groupe ne correspondait. Par exemple, les expressions ``(a)b``, ``((a)(b))`` "
"et ``((ab))`` auront un ``lastindex == 1`` si appliquées à la chaîne "
"``'ab'``, alors que l'expression ``(a)(b)`` aura un ``lastindex == 2`` si "
"appliquée à la même chaîne."
#: ../Doc/library/re.rst:1155 #: ../Doc/library/re.rst:1155
msgid "" msgid ""
"The name of the last matched capturing group, or ``None`` if the group " "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." "didn't have a name, or if no group was matched at all."
msgstr "" msgstr ""
"Le nom du dernier groupe capturant validé, ou ``None`` si le groupe n'a pas "
"de nom, ou si aucun groupe ne correspondait."
#: ../Doc/library/re.rst:1161 #: ../Doc/library/re.rst:1161
msgid "" msgid ""
"The regular expression object whose :meth:`~regex.match` or :meth:`~regex." "The regular expression object whose :meth:`~regex.match` or :meth:`~regex."
"search` method produced this match instance." "search` method produced this match instance."
msgstr "" msgstr ""
"L'expression rationnelle dont la méthode :meth:`~regex.match` ou :meth:"
"`~regex.search` a produit cet objet de correspondance."
#: ../Doc/library/re.rst:1167 #: ../Doc/library/re.rst:1167
msgid "The string passed to :meth:`~regex.match` or :meth:`~regex.search`." msgid "The string passed to :meth:`~regex.match` or :meth:`~regex.search`."
msgstr "" msgstr "La chaîne passée à :meth:`~regex.match` ou :meth:`~regex.search`."
#: ../Doc/library/re.rst:1173 #: ../Doc/library/re.rst:1173
msgid "Regular Expression Examples" msgid "Regular Expression Examples"
msgstr "" msgstr "Exemples d'expressions rationnelles"
#: ../Doc/library/re.rst:1177 #: ../Doc/library/re.rst:1177
msgid "Checking for a Pair" msgid "Checking for a Pair"
msgstr "" msgstr "Rechercher une paire"
#: ../Doc/library/re.rst:1179 #: ../Doc/library/re.rst:1179
msgid "" msgid ""
"In this example, we'll use the following helper function to display match " "In this example, we'll use the following helper function to display match "
"objects a little more gracefully:" "objects a little more gracefully:"
msgstr "" msgstr ""
"Dans cet exemple, nous utiliserons cette fonction de facilité pour afficher "
"les objets de correspondance sous une meilleure forme :"
#: ../Doc/library/re.rst:1189 #: ../Doc/library/re.rst:1189
msgid "" msgid ""
@ -1875,10 +2093,18 @@ msgid ""
"ace, \"k\" for king, \"q\" for queen, \"j\" for jack, \"t\" for 10, and " "ace, \"k\" for king, \"q\" for queen, \"j\" for jack, \"t\" for 10, and "
"\"2\" through \"9\" representing the card with that value." "\"2\" through \"9\" representing the card with that value."
msgstr "" msgstr ""
"Supposez que vous écriviez un jeu de poker où la main d'un joueur est "
"représentée par une chaîne de 5 caractères avec chaque caractère "
"représentant une carte, \"a\" pour l'as, \"k\" pour le roi (*king*), \"q\" "
"pour la reine (*queen*), \"j\" pour le valet (*jack*), \"t\" pour 10 "
"(*ten*), et les caractères de \"2\" à \"9\" représentant les cartes avec ces "
"valeurs."
#: ../Doc/library/re.rst:1194 #: ../Doc/library/re.rst:1194
msgid "To see if a given string is a valid hand, one could do the following:" msgid "To see if a given string is a valid hand, one could do the following:"
msgstr "" msgstr ""
"Pour vérifier qu'une chaîne donnée est une main valide, on pourrait faire "
"comme suit :"
#: ../Doc/library/re.rst:1204 #: ../Doc/library/re.rst:1204
msgid "" msgid ""
@ -1886,16 +2112,22 @@ msgid ""
"cards. To match this with a regular expression, one could use backreferences " "cards. To match this with a regular expression, one could use backreferences "
"as such:" "as such:"
msgstr "" msgstr ""
"La dernière main, ``\"727ak\"``, contenait une paire, deux cartes de la même "
"valeur. Pour valider cela avec une expression rationnelle, on pourrait "
"utiliser des références arrière comme :"
#: ../Doc/library/re.rst:1214 #: ../Doc/library/re.rst:1214
msgid "" msgid ""
"To find out what card the pair consists of, one could use the :meth:`~match." "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:" "group` method of the match object in the following manner:"
msgstr "" msgstr ""
"Pour trouver de quelle carte est composée la paire, on pourrait utiliser la "
"méthode :meth:`~match.group` de l'objet de correspondance de la manière "
"suivante :"
#: ../Doc/library/re.rst:1234 #: ../Doc/library/re.rst:1234
msgid "Simulating scanf()" msgid "Simulating scanf()"
msgstr "" msgstr "Simuler scanf()"
#: ../Doc/library/re.rst:1238 #: ../Doc/library/re.rst:1238
msgid "" msgid ""
@ -1905,14 +2137,19 @@ msgid ""
"equivalent mappings between :c:func:`scanf` format tokens and regular " "equivalent mappings between :c:func:`scanf` format tokens and regular "
"expressions." "expressions."
msgstr "" msgstr ""
"Python n'a actuellement pas d'équivalent à la fonction C :c:func:`scanf`. "
"Les expressions rationnelles sont généralement plus puissantes, mais aussi "
"plus verbeuses, que les chaînes de format :c:func:`scanf`. Le tableau "
"suivant présente des expressions rationnelles plus ou moins équivalentes aux "
"éléments de formats de :c:func:`scanf`."
#: ../Doc/library/re.rst:1245 #: ../Doc/library/re.rst:1245
msgid ":c:func:`scanf` Token" msgid ":c:func:`scanf` Token"
msgstr "" msgstr "Élément de :c:func:`scanf`"
#: ../Doc/library/re.rst:1245 #: ../Doc/library/re.rst:1245
msgid "Regular Expression" msgid "Regular Expression"
msgstr "" msgstr "Expression rationnelle"
#: ../Doc/library/re.rst:1247 #: ../Doc/library/re.rst:1247
msgid "``%c``" msgid "``%c``"
@ -1989,18 +2226,19 @@ msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``"
#: ../Doc/library/re.rst:1266 #: ../Doc/library/re.rst:1266
msgid "To extract the filename and numbers from a string like ::" msgid "To extract the filename and numbers from a string like ::"
msgstr "" msgstr ""
"Pour extraire le nom de fichier et les nombres depuis une chaîne comme : ::"
#: ../Doc/library/re.rst:1270 #: ../Doc/library/re.rst:1270
msgid "you would use a :c:func:`scanf` format like ::" msgid "you would use a :c:func:`scanf` format like ::"
msgstr "" msgstr "vous utiliseriez un format :c:func:`scanf` comme : ::"
#: ../Doc/library/re.rst:1274 #: ../Doc/library/re.rst:1274
msgid "The equivalent regular expression would be ::" msgid "The equivalent regular expression would be ::"
msgstr "" msgstr "L'expression rationnelle équivalente serait : ::"
#: ../Doc/library/re.rst:1282 #: ../Doc/library/re.rst:1282
msgid "search() vs. match()" msgid "search() vs. match()"
msgstr "" msgstr "search() vs. match()"
#: ../Doc/library/re.rst:1286 #: ../Doc/library/re.rst:1286
msgid "" msgid ""
@ -2009,6 +2247,10 @@ msgid ""
"the string, while :func:`re.search` checks for a match anywhere in the " "the string, while :func:`re.search` checks for a match anywhere in the "
"string (this is what Perl does by default)." "string (this is what Perl does by default)."
msgstr "" msgstr ""
"Python offre deux opérations primitives basées sur les expressions "
"rationnelles : :func:`re.match` cherche une correspondance uniquement au "
"début de la chaîne, tandis que :func:`re.search` en recherche une n'importe "
"où dans la chaîne (ce que fait Perl par défaut)."
#: ../Doc/library/re.rst:1291 #: ../Doc/library/re.rst:1291
msgid "For example::" msgid "For example::"
@ -2019,6 +2261,8 @@ msgid ""
"Regular expressions beginning with ``'^'`` can be used with :func:`search` " "Regular expressions beginning with ``'^'`` can be used with :func:`search` "
"to restrict the match at the beginning of the string::" "to restrict the match at the beginning of the string::"
msgstr "" msgstr ""
"Les expressions rationnelles commençant par ``'^'`` peuvent être utilisées "
"avec :func:`search` pour restreindre la recherche au début de la chaîne : ::"
#: ../Doc/library/re.rst:1305 #: ../Doc/library/re.rst:1305
msgid "" msgid ""
@ -2026,10 +2270,13 @@ msgid ""
"the beginning of the string, whereas using :func:`search` with a regular " "the beginning of the string, whereas using :func:`search` with a regular "
"expression beginning with ``'^'`` will match at the beginning of each line." "expression beginning with ``'^'`` will match at the beginning of each line."
msgstr "" msgstr ""
"Notez cependant qu'en mode :const:`MULTILINE`, :func:`match`ne recherche "
"qu'au début de la chaîne, alors que :func:`search` avec une expression "
"rationnelle commençant par ``'^'`` recherchera au début de chaque ligne."
#: ../Doc/library/re.rst:1315 #: ../Doc/library/re.rst:1315
msgid "Making a Phonebook" msgid "Making a Phonebook"
msgstr "" msgstr "Construire un répertoire téléphonique"
#: ../Doc/library/re.rst:1317 #: ../Doc/library/re.rst:1317
msgid "" msgid ""
@ -2038,18 +2285,27 @@ msgid ""
"that can be easily read and modified by Python as demonstrated in the " "that can be easily read and modified by Python as demonstrated in the "
"following example that creates a phonebook." "following example that creates a phonebook."
msgstr "" msgstr ""
":func:`split` découpe une chaîne en une liste délimitée par le motif donné. "
"La méthode est inestimable pour convertir des données textuelles vers des "
"structures de données qui peuvent être lues et modifiées par Python comme "
"démontré dans l'exemple suivant qui crée un répertoire téléphonique."
#: ../Doc/library/re.rst:1322 #: ../Doc/library/re.rst:1322
msgid "" msgid ""
"First, here is the input. Normally it may come from a file, here we are " "First, here is the input. Normally it may come from a file, here we are "
"using triple-quoted string syntax:" "using triple-quoted string syntax:"
msgstr "" msgstr ""
"Premièrement, voici l'entrée. Elle provient normalement d'un fichier, nous "
"utilisons ici une chaîne à guillemets triples :"
#: ../Doc/library/re.rst:1333 #: ../Doc/library/re.rst:1333
msgid "" msgid ""
"The entries are separated by one or more newlines. Now we convert the string " "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:" "into a list with each nonempty line having its own entry:"
msgstr "" msgstr ""
"Les entrées sont séparées par un saut de ligne ou plus. Nous convertissons "
"maintenant la chaîne en une liste où chaque ligne non vide aura sa propre "
"entrée :"
#: ../Doc/library/re.rst:1346 #: ../Doc/library/re.rst:1346
msgid "" msgid ""
@ -2057,6 +2313,10 @@ msgid ""
"number, and address. We use the ``maxsplit`` parameter of :func:`split` " "number, and address. We use the ``maxsplit`` parameter of :func:`split` "
"because the address has spaces, our splitting pattern, in it:" "because the address has spaces, our splitting pattern, in it:"
msgstr "" msgstr ""
"Finalement, on sépare chaque entrée en une liste avec prénom, nom, numéro de "
"téléphone et adresse. Nous utilisons le paramètre ``maxsplit`` de :func:"
"`split` parce que l'adresse contient des espaces, qui sont notre motif de "
"séparation :"
#: ../Doc/library/re.rst:1359 #: ../Doc/library/re.rst:1359
msgid "" msgid ""
@ -2064,10 +2324,13 @@ msgid ""
"not occur in the result list. With a ``maxsplit`` of ``4``, we could " "not occur in the result list. With a ``maxsplit`` of ``4``, we could "
"separate the house number from the street name:" "separate the house number from the street name:"
msgstr "" msgstr ""
"Le motif ``:?`` trouve les deux points derrière le nom de famille, pour "
"qu'ils n'apparaissent pas dans la liste résultante. Avec un ``maxsplit`` de "
"``4``, nous pourrions séparer le numéro du nom de la rue."
#: ../Doc/library/re.rst:1374 #: ../Doc/library/re.rst:1374
msgid "Text Munging" msgid "Text Munging"
msgstr "" msgstr "Mélanger les lettres des mots"
#: ../Doc/library/re.rst:1376 #: ../Doc/library/re.rst:1376
msgid "" msgid ""
@ -2076,10 +2339,14 @@ msgid ""
"function to \"munge\" text, or randomize the order of all the characters in " "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::" "each word of a sentence except for the first and last characters::"
msgstr "" msgstr ""
":func:`sub` remplace toutes les occurrences d'un motif par une chaîne ou le "
"résultat d'une fonction. Cet exemple le montre, en utilisant :func:`sub` "
"avec une fonction qui mélange aléatoirement les caractères de chaque mot "
"dans une phrase (à l'exception des premiers et derniers caractères) : ::"
#: ../Doc/library/re.rst:1393 #: ../Doc/library/re.rst:1393
msgid "Finding all Adverbs" msgid "Finding all Adverbs"
msgstr "" msgstr "Trouver tous les adverbes"
#: ../Doc/library/re.rst:1395 #: ../Doc/library/re.rst:1395
msgid "" msgid ""
@ -2088,10 +2355,14 @@ msgid ""
"find all of the adverbs in some text, he or she might use :func:`findall` in " "find all of the adverbs in some text, he or she might use :func:`findall` in "
"the following manner:" "the following manner:"
msgstr "" msgstr ""
":func:`findall` trouve *toutes* les occurrences d'un motif, pas juste la "
"première comme le fait :func:`search`. Par exemple, si un(e) écrivain(e) "
"voulait trouver tous les adverbes dans un texte, il/elle devrait utiliser :"
"func:`findall` de la manière suivante :"
#: ../Doc/library/re.rst:1406 #: ../Doc/library/re.rst:1406
msgid "Finding all Adverbs and their Positions" msgid "Finding all Adverbs and their Positions"
msgstr "" msgstr "Trouver tous les adverbes et leurs positions"
#: ../Doc/library/re.rst:1408 #: ../Doc/library/re.rst:1408
msgid "" msgid ""
@ -2102,10 +2373,16 @@ msgid ""
"positions* in some text, he or she would use :func:`finditer` in the " "positions* in some text, he or she would use :func:`finditer` in the "
"following manner:" "following manner:"
msgstr "" msgstr ""
"Pour obtenir plus d'informations sur les correspondances que juste le texte "
"trouvé, :func:`finditer` est utile en fournissant des :ref:`objets de "
"correspondance <match-objects>` plutôt que des chaînes. En continuant avec "
"le précédent exemple, si l'écrivain(e) voulait trouver tous les adverbes *et "
"leurs positions* dans un texte, il/elle utiliserait :func:`finditer` de la "
"manière suivante :"
#: ../Doc/library/re.rst:1422 #: ../Doc/library/re.rst:1422
msgid "Raw String Notation" msgid "Raw String Notation"
msgstr "" msgstr "Notation brutes de chaînes"
#: ../Doc/library/re.rst:1424 #: ../Doc/library/re.rst:1424
msgid "" msgid ""
@ -2114,6 +2391,11 @@ msgid ""
"prefixed with another one to escape it. For example, the two following " "prefixed with another one to escape it. For example, the two following "
"lines of code are functionally identical:" "lines of code are functionally identical:"
msgstr "" msgstr ""
"La notation brute de chaînes (``r\"text\"``) garde saines les expressions "
"rationnelles. Sans elle, chaque *backslash* (``'\\'``) dans une expression "
"rationnelle devrait être préfixé d'un autre *backslash* pour l'échapper. "
"Par exemple, les deux lignes de code suivantes sont fonctionnellement "
"identiques :"
#: ../Doc/library/re.rst:1434 #: ../Doc/library/re.rst:1434
msgid "" msgid ""
@ -2122,10 +2404,14 @@ msgid ""
"Without raw string notation, one must use ``\"\\\\\\\\\"``, making the " "Without raw string notation, one must use ``\"\\\\\\\\\"``, making the "
"following lines of code functionally identical:" "following lines of code functionally identical:"
msgstr "" msgstr ""
"Pour rechercher un *backslash* littéral, il faut l'échapper dans "
"l'expression rationnelle. Avec la notation brute, cela signifie ``r\"\\\\"
"\"``. Sans elle, il faudrait utiliser ``\"\\\\\\\\\"``, faisant que les "
"deux lignes de code suivantes sont fonctionnellement identiques :"
#: ../Doc/library/re.rst:1446 #: ../Doc/library/re.rst:1446
msgid "Writing a Tokenizer" msgid "Writing a Tokenizer"
msgstr "" msgstr "Écrire un analyseur lexical"
#: ../Doc/library/re.rst:1448 #: ../Doc/library/re.rst:1448
msgid "" msgid ""
@ -2133,6 +2419,10 @@ msgid ""
"analyzes a string to categorize groups of characters. This is a useful " "analyzes a string to categorize groups of characters. This is a useful "
"first step in writing a compiler or interpreter." "first step in writing a compiler or interpreter."
msgstr "" msgstr ""
"Un `analyseur lexical ou scanner <https://en.wikipedia.org/wiki/"
"Lexical_analysis>`_ analyse une chaîne pour catégoriser les groupes de "
"caractères. C'est une première étape utile dans l'écriture d'un compilateur "
"ou d'un interpréteur."
#: ../Doc/library/re.rst:1452 #: ../Doc/library/re.rst:1452
msgid "" msgid ""
@ -2140,7 +2430,10 @@ msgid ""
"is to combine those into a single master regular expression and to loop over " "is to combine those into a single master regular expression and to loop over "
"successive matches::" "successive matches::"
msgstr "" msgstr ""
"Les catégories de texte sont spécifiées par des expressions rationnelles. "
"La technique est de les combiner dans une unique expression rationnelle "
"maîtresse, et de boucler sur les correspondances successives : ::"
#: ../Doc/library/re.rst:1502 #: ../Doc/library/re.rst:1502
msgid "The tokenizer produces the following output::" msgid "The tokenizer produces the following output::"
msgstr "" msgstr "L'analyseur produit la sortie suivante : ::"